Bounded JSON Schema 2020-12 and draft-07 validation.
JSV evaluates the declared dialect, including reference scope and evaluation
annotations. Network resolvers and data casting are disabled. Format
assertions remain enabled for compatibility; pass formats: false to use
the dialect's format annotation semantics. Defaults remain annotations unless
explicitly applied.
Summary
Functions
Applies bounded, direct JSON Schema property defaults and validates the result.
Returns an exported schema root with the default dialect made explicit.
Checks that a term can be represented losslessly as JSON.
Returns the dialects accepted in an explicit $schema declaration.
Validates the original JSON instance without casting or inserting defaults.
Validates the bounded modern result variants emitted by this package.
Checks the schema's declared dialect without fetching network references.
Functions
@spec apply_property_defaults(map(), map() | boolean(), keyword()) :: {:ok, map()} | {:error, term()}
Applies bounded, direct JSON Schema property defaults and validates the result.
Only defaults reached through literal properties entries are applied. The
helper recurses into existing object properties and objects supplied by an
explicit property default. It does not infer defaults through references,
combinators, conditionals, array items, or pattern properties, and it never
creates an absent parent object unless that property declares its own
default.
Presence is determined with Map.has_key?/2, so nil, false, zero, and an
empty string are never replaced. At most 500 defaults are applied, and the
completed value must satisfy the normal depth, node, byte, and schema bounds.
Server dispatch never calls this helper automatically.
Returns an exported schema root with the default dialect made explicit.
An object schema without $schema receives the canonical JSON Schema
2020-12 identifier, which is the dialect the validator already applies. An
explicit $schema, a boolean schema, and every nested value are returned
unchanged.
Checks that a term can be represented losslessly as JSON.
@spec supported_dialects() :: [String.t()]
Returns the dialects accepted in an explicit $schema declaration.
Validates the original JSON instance without casting or inserting defaults.
Validates the bounded modern result variants emitted by this package.
Checks the schema's declared dialect without fetching network references.