Transforms raw JSON Schema maps into executable Schema structs.
Compilation has two phases:
- Node compilation — Recursively converts keywords into
Rulestructs (validation closures), resolves vocabularies, and compiles$defs. - Scope scanning — Discovers all
$idand anchor definitions across the schema tree and registers them by absolute URI for reference resolution.
Standard rules execute first; finalizer rules (unevaluatedProperties,
unevaluatedItems) run last so they can see which keys were already evaluated.
Examples
iex> {:ok, schema} = JSONSchex.Compiler.compile(%{"type" => "string"})
iex> length(schema.rules)
1
Summary
Functions
Compiles a raw JSON Schema into an executable Schema struct.
Functions
Compiles a raw JSON Schema into an executable Schema struct.
See JSONSchex.compile/2 for options and usage.