jsonschema.validator

Instance validation: evaluating a compiled schema against a JSON value of any adapted type. Implements full 2020-12 evaluation semantics including annotation collection for unevaluatedProperties / unevaluatedItems and dynamic-scope resolution for $dynamicRef.

Members

Classes

Validator
class Validator

A compiled, reusable schema validator. Create via compileSchema; then validate any number of instances of either built-in JSON type (or any custom-adapted type via validateWith).

Functions

cmpNumbers
int cmpNumbers(JsonNumber a, JsonNumber b)

Compare two JSON numbers exactly: integer representations never round-trip through a double; an integral/floating comparison is decided via floor().

deepEqualValues
bool deepEqualValues(A.Value a, A.Value b)

Deep equality between two instance values of the same adapted type (uniqueItems), with cross-representation number equality.

isMultipleOf
bool isMultipleOf(JsonNumber v, JsonNumber m)

JSON Schema multipleOf. Exact integer arithmetic when both operands are integral; otherwise a quotient-rounding check with a small relative tolerance (so 0.0075 is a multiple of 0.0001 despite binary representation).

valueEqualsNode
bool valueEqualsNode(A.Value v, JsonNode n, JsonKind kind)

Deep equality between an instance value (any adapter) and a schema-side JsonNode (for const / enum), with cross-representation number equality.

Structs

Evaluated
struct Evaluated

Annotation collector for one (schema, instance-location) evaluation: which object properties and array items have been successfully evaluated. This is what unevaluatedProperties / unevaluatedItems consult, after merging the collectors of all successful in-place applicator branches.