jsonschema.compiler

Schema compilation: JSON document → IR.

compileSchema normalizes the input, detects the dialect via $schema, walks every schema location building CompiledSchema nodes, registers resources / anchors / pointer maps, and resolves all $ref edges eagerly.

Members

Classes

Session
class Session
Undocumented in source.

Functions

compileDocument
SchemaResource compileDocument(Session sess, JsonNode doc, string retrievalUri)

Compile one document; returns its root resource. The root resource is registered under both its $id (when present) and the retrieval URI.

compileSchema
Validator compileSchema(JsonNode doc, ValidatorSettings settings)

Compile a schema document (already normalized) into a reusable validator.

compileSchema
Validator compileSchema(string jsonText, ValidatorSettings settings)

Compile a schema from JSON text.

compileSchema
Validator compileSchema(std.json.JSONValue doc, ValidatorSettings settings)

Compile a schema given as a std.json value.

ecmaShorthand
string ecmaShorthand(string src)

Translate the ECMA-262 shorthand classes \d \w \s (and negations) into their ASCII-only / ECMA-exact equivalents. std.regex interprets them as Unicode-aware classes, but JSON Schema patterns use ECMA-262 semantics where \d is exactly [0-9] and \w is [A-Za-z0-9_].

vocabulariesFor
Vocabularies vocabulariesFor(Session sess, string dialectUri)

Determine the vocabulary set for a dialect URI. The standard 2020-12 URI maps directly; any other URI must name a registered meta-schema document, whose $vocabulary is honored. Unknown dialects are refused.