Liking cljdoc? Tell your friends :D

com.blockether.skjema.core

JSON Schema 2020-12 evaluation.

The evaluator answers ANNOTATIONS as well as errors, from the first line and not as a later addition: unevaluatedProperties and unevaluatedItems are defined in terms of what the ADJACENT keywords and the in-place applicators already evaluated, so a validator that answers only true/false cannot grow them without being rewritten. Every evaluation therefore returns {:valid? :props :items :errors} - the property names and item indices that were evaluated AT THIS INSTANCE LOCATION, plus every fault found underneath.

Two kinds of applicator, and the difference is the whole design:

  • IN PLACE ($ref, $dynamicRef, allOf, anyOf, oneOf, if/then/ else, dependentSchemas) apply another schema to the SAME instance location, so their annotations belong to this location and bubble up.
  • CHILD (properties, patternProperties, additionalProperties, items, prefixItems, contains, propertyNames) apply to a location BELOW, so their annotations stay there and this location records only which member was covered.

Identifiers are resolved once, when the schema is compiled: $id moves the base URI, $anchor and $dynamicAnchor name a place inside it, and the index that comes out is what $ref and $dynamicRef read. Nothing is fetched over the network, ever - a schema that references a document the caller did not supply is a compile error, not a silent pass.

JSON Schema 2020-12 evaluation.

The evaluator answers ANNOTATIONS as well as errors, from the first line and
not as a later addition: `unevaluatedProperties` and `unevaluatedItems` are
defined in terms of what the ADJACENT keywords and the in-place applicators
already evaluated, so a validator that answers only true/false cannot grow
them without being rewritten. Every evaluation therefore returns
`{:valid? :props :items :errors}` - the property names and item indices that
were evaluated AT THIS INSTANCE LOCATION, plus every fault found underneath.

Two kinds of applicator, and the difference is the whole design:

- IN PLACE (`$ref`, `$dynamicRef`, `allOf`, `anyOf`, `oneOf`, `if`/`then`/
  `else`, `dependentSchemas`) apply another schema to the SAME instance
  location, so their annotations belong to this location and bubble up.
- CHILD (`properties`, `patternProperties`, `additionalProperties`, `items`,
  `prefixItems`, `contains`, `propertyNames`) apply to a location BELOW, so
  their annotations stay there and this location records only which member
  was covered.

Identifiers are resolved once, when the schema is compiled: `$id` moves the
base URI, `$anchor` and `$dynamicAnchor` name a place inside it, and the
index that comes out is what `$ref` and `$dynamicRef` read. Nothing is
fetched over the network, ever - a schema that references a document the
caller did not supply is a compile error, not a silent pass.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close