Skip to main content

Crate json_schema_ast

Crate json_schema_ast 

Source
Expand description

Strict Draft 2020-12 schema documents, validation, and resolved schema IR.

The main entry point is SchemaDocument. Build one from raw JSON with SchemaDocument::from_json, validate instances with SchemaDocument::is_valid, and use compile only when you need direct access to the underlying validator backend. Crates that implement analysis or generation can inspect the lazily resolved canonical IR with SchemaDocument::root.

Structs§

ContainsConstraint
Array contains constraints are stored as a single structured value so the count bounds cannot drift out of sync with the subschema itself.
CountRange
Inclusive count range with optional upper bound.
IntegerBounds
A canonical closed interval over signed 64-bit integers.
IntegerMultipleOf
Positive multipleOf constraint stored on integer schemas.
JSONSchema
A compiled JSON Schema validator.
NodeId
Stable identity for one in-memory schema node within the lifetime of the AST.
NumberBounds
A validated floating-point interval with finite endpoints.
NumberMultipleOf
Positive multipleOf constraint stored on number schemas.
PatternConstraint
A pattern constraint with cached matcher state and its original source text.
PatternProperty
One patternProperties entry with both the source pattern and compiled matcher.
SchemaDocument
Fully resolved JSON Schema document.
SchemaNode
Shared immutable representation of a resolved JSON Schema node.

Enums§

AstError
CompileError
NumberBound
One finite lower/upper bound for a floating-point interval.
PatternSupport
Whether a regex pattern can be executed by the internal Rust matcher.
SchemaError
SchemaNodeKind
A resolved, executable JSON Schema node.

Functions§

compile
Compile a JSON Schema document directly with the validator backend.
json_values_equal
Return true when two JSON values are equal under JSON Schema semantics.

Type Aliases§

SchemaBuildError
Public schema-build error name used by SchemaDocument::from_json.