Registry mapping :kind keywords to their conformed schemas. Provides for-kind lookup and throwing variants of schema's present!/coerce!/conform! that auto-resolve the schema from (:kind entity).
Registry mapping `:kind` keywords to their conformed schemas. Provides `for-kind` lookup and throwing variants of schema's `present!`/`coerce!`/`conform!` that auto-resolve the schema from `(:kind entity)`.
(build schemas)Build a {kind -> schema} registry from a (possibly nested) sequence of schemas.
Schemas without a :kind are filtered out; remaining schemas are conformed via
schema/conform-schema! and indexed by (-> schema :kind :value).
Build a `{kind -> schema}` registry from a (possibly nested) sequence of schemas.
Schemas without a `:kind` are filtered out; remaining schemas are conformed via
`schema/conform-schema!` and indexed by `(-> schema :kind :value)`.(coerce! entity)(coerce! index entity)Run schema/coerce! for entity using the schema registered for
(:kind entity). Returns nil when entity is nil. Throws if no schema is
registered for that kind, or if coercion fails.
Run `schema/coerce!` for `entity` using the schema registered for `(:kind entity)`. Returns nil when `entity` is nil. Throws if no schema is registered for that kind, or if coercion fails.
(conform! entity)(conform! index entity)Run schema/conform! (coerce + validate) for entity using the schema
registered for (:kind entity). Returns nil when entity is nil. Throws if no
schema is registered for that kind, or if conformance fails.
Run `schema/conform!` (coerce + validate) for `entity` using the schema registered for `(:kind entity)`. Returns nil when `entity` is nil. Throws if no schema is registered for that kind, or if conformance fails.
(for-kind kind)(for-kind index kind)Look up the schema for kind. Arity-1 uses the global registry installed by
init!; arity-2 takes an explicit registry. Throws ex-info if no schema is
registered for kind.
Look up the schema for `kind`. Arity-1 uses the global registry installed by `init!`; arity-2 takes an explicit registry. Throws `ex-info` if no schema is registered for `kind`.
(init! schemas)Install schemas (a {kind -> schema} map, typically from build) as the
global default registry used by the arity-1 for-kind/present!/coerce!/conform!.
Install `schemas` (a `{kind -> schema}` map, typically from `build`) as the
global default registry used by the arity-1 `for-kind`/`present!`/`coerce!`/`conform!`.(present! entity)(present! index entity)Run schema/present! for entity using the schema registered for
(:kind entity). Returns nil when entity is nil. Throws if no schema is
registered for that kind, or if presentation fails.
Run `schema/present!` for `entity` using the schema registered for `(:kind entity)`. Returns nil when `entity` is nil. Throws if no schema is registered for that kind, or if presentation fails.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |