jsonschema.ir

The compiled internal representation of a JSON Schema document.

Schema documents are compiled once into this IR — keyword tables, compiled regexes, resolved $ref targets, and anchor maps all live here, never in the source JSON type. Instances of any JSON type are then validated against the IR via the adapter trait (see jsonschema.adapter).

Members

Aliases

SchemaResolver
alias SchemaResolver = JsonNode delegate(string uri) @(safe)

Resolver callback for loading schema documents this library has no local copy of. Never invoked unless the caller supplies one — reference resolution is local-only by default and the library itself performs no I/O.

Classes

CompiledSchema
class CompiledSchema

One compiled subschema. All keyword storage is pre-parsed; absent keywords are null references, absent sentinels, or cleared has* flags.

SchemaCompileException
class SchemaCompileException

Malformed schema document, invalid keyword value, or unresolvable $ref.

SchemaException
class SchemaException

Base class for all schema compilation problems.

SchemaRef
class SchemaRef

A $ref / $dynamicRef edge in the IR.

SchemaResource
class SchemaResource

A schema resource: a document root or an embedded subschema carrying $id.

UnsupportedDialectException
class UnsupportedDialectException

The schema declares (via $schema) a dialect this library does not implement. Callers required to reject unknown dialects (e.g. MCP servers) can catch this specifically.

ValidationException
class ValidationException

Validation could not run to completion (currently: the evaluation depth limit was hit, which indicates an unboundedly recursive schema).

Enums

FormatMode
enum FormatMode

How the format keyword behaves.

OutputFormat
enum OutputFormat

Spec output formats supported by validate.

TypeBit
enum TypeBit

Bit flags for the type keyword.

Manifest constants

dialect202012
enum dialect202012;

URI of the JSON Schema 2020-12 dialect (the default and currently the only fully supported dialect).

Structs

PatternProperty
struct PatternProperty

patternProperties entry: source text, compiled regex, value schema.

ValidationError
struct ValidationError

One output unit of the basic output format.

ValidationResult
struct ValidationResult

Result of validating one instance.

ValidatorSettings
struct ValidatorSettings

Compilation / validation settings. Pass to compileSchema.

Vocabularies
struct Vocabularies

The set of 2020-12 vocabularies in effect for a schema resource. Keywords whose vocabulary is disabled by a custom meta-schema's $vocabulary are not compiled (they behave as unknown keywords).

Variables

absent
enum long absent;

Sentinel meaning "keyword absent" for the non-negative integer keywords.