(-with-doc the-schema docstring)Add a :doc/message option to a schema. Tries to merge it in existing vector schemas to avoid unnecessary
indirection.
Add a `:doc/message` option to a `schema`. Tries to merge it in existing vector schemas to avoid unnecessary indirection.
(cached k schema value-thunk)Get a cached value for k + schema. Cache is cleared whenever a schema is (re)defined
with macaw.util.malli.registry/def. If value doesn't exist, value-thunk is used to calculate (and cache)
it.
You generally shouldn't use this outside of this namespace unless you have a really good reason to do so! Make sure you used namespaced keys if you are using it elsewhere.
Get a cached value for `k` + `schema`. Cache is cleared whenever a schema is (re)defined with [[macaw.util.malli.registry/def]]. If value doesn't exist, `value-thunk` is used to calculate (and cache) it. You generally shouldn't use this outside of this namespace unless you have a really good reason to do so! Make sure you used namespaced keys if you are using it elsewhere.
(def type the-schema)(def type docstring the-schema)Like [[clojure.spec.alpha/def]]; add a Malli schema to our registry.
Like [[clojure.spec.alpha/def]]; add a Malli schema to our registry.
(explain schema value)[[mc/explain]], but uses a cached explainer from explainer.
[[mc/explain]], but uses a cached explainer from [[explainer]].
(explainer schema)Fetch a cached [[mc/explainer]] for schema, creating one if needed. The cache is flushed whenever the registry
changes.
Fetch a cached [[mc/explainer]] for `schema`, creating one if needed. The cache is flushed whenever the registry changes.
(register! schema definition)Register a spec with our Malli spec registry.
Register a spec with our Malli spec registry.
(resolve-schema the-schema)For REPL/test usage: get the definition of a registered schema from the registry.
For REPL/test usage: get the definition of a registered schema from the registry.
(schema type)Get the Malli schema for type from the registry.
Get the Malli schema for `type` from the registry.
(validate schema value)[[mc/validate]], but uses a cached validator from validator.
[[mc/validate]], but uses a cached validator from [[validator]].
(validator schema)Fetch a cached [[mc/validator]] for schema, creating one if needed. The cache is flushed whenever the registry
changes.
Fetch a cached [[mc/validator]] for `schema`, creating one if needed. The cache is flushed whenever the registry changes.
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 |