A collection spec represents a collection of elements, each of which is itself schematized.
A collection spec represents a collection of elements, each of which is itself schematized.
(all-elements schema)
(collection-spec pre constructor elements on-error)
A collection represents a collection of elements, each of which is itself schematized. At the top level, the collection has a precondition (presumably on the overall type), a constructor for the collection from a sequence of items, an element spec, and a function that constructs a descriptive error on failure.
The element spec is a nested list structure, in which the leaf elements each
provide an element schema, parser (allowing for efficient processing of structured
collections), and optional error wrapper. Each item in the list can be a leaf
element or an optional
nested element spec (see below). In addition, the final
element can be a remaining
schema (see below).
Note that the optional
carries no semantics with respect to validation;
the user must ensure that the parser enforces the desired semantics, which
should match the structure of the spec for proper generation.
A collection represents a collection of elements, each of which is itself schematized. At the top level, the collection has a precondition (presumably on the overall type), a constructor for the collection from a sequence of items, an element spec, and a function that constructs a descriptive error on failure. The element spec is a nested list structure, in which the leaf elements each provide an element schema, parser (allowing for efficient processing of structured collections), and optional error wrapper. Each item in the list can be a leaf element or an `optional` nested element spec (see below). In addition, the final element can be a `remaining` schema (see below). Note that the `optional` carries no semantics with respect to validation; the user must ensure that the parser enforces the desired semantics, which should match the structure of the spec for proper generation.
(one-element required? schema parser)
(optional & ss)
If any more elements are present, they must match the elements in 'ss'
If any more elements are present, they must match the elements in 'ss'
(optional-tail schema parser more)
(remaining s)
All remaining elements must match schema s
All remaining elements must match schema s
(subschemas elt)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close