Documentation
¶
Overview ¶
Package jsonschema implements the single JSON Schema subset that BuildMax's provider-neutral structured output (docs/design/structured-output.md §6) and Workflow input schemas (docs/design/workflow-runtime.md §6.1) both reference. One definition, checked once, means the same thing at every boundary.
The subset is deliberately narrow: objects, the scalar types (string/number/integer/boolean), enums, arrays, required, and additionalProperties:false. Every keyword must be both expressible in each provider's native mechanism and checkable here, so a keyword only one provider supports stays out until a consumer needs it. Growing the subset is adding a keyword when a consumer requires it, never before.
Index ¶
Constants ¶
const ( TypeObject = "object" TypeArray = "array" TypeString = "string" TypeNumber = "number" TypeInteger = "integer" TypeBoolean = "boolean" )
Supported type keywords.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema is a compiled schema in the supported subset. Compile it once and validate many values against it.
func Compile ¶
func Compile(raw json.RawMessage) (*Schema, error)
Compile parses raw and verifies it is within the supported subset, returning a reusable Schema or an error naming the first unsupported construct. Workflow publication uses it to reject an out-of-subset schema; the runtime uses the result to validate values.