Liking cljdoc? Tell your friends :D

c3kit.apron.legend

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)`.
raw docstring

buildclj/s

(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)`.
raw docstring

coerce!clj/s

(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.
raw docstring

conform!clj/s

(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.
raw docstring

for-kindclj/s

(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`.
raw docstring

indexclj/s


init!clj/s

(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!`.
raw docstring

present!clj/s

(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.
raw docstring

retractclj/s

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