(assoc ?schema key value)
(assoc ?schema key value options)
Like [[clojure.core/assoc]], but for LensSchemas.
Like [[clojure.core/assoc]], but for LensSchemas.
(assoc-in ?schema ks value)
(assoc-in ?schema [k & ks] value options)
Like [[clojure.core/assoc-in]], but for LensSchemas.
Like [[clojure.core/assoc-in]], but for LensSchemas.
(closed-schema ?schema)
(closed-schema ?schema options)
Maps are implicitly open by default. They can be explicitly closed or
open by specifying the {:closed (true|false)}
property.
This function converts implicitly open maps to explicitly closed maps, recursively. Explicitly open maps are left untouched.
See open-schema
Maps are implicitly open by default. They can be explicitly closed or open by specifying the `{:closed (true|false)}` property. This function converts implicitly open maps to explicitly closed maps, recursively. Explicitly open maps are left untouched. See [[open-schema]]
(data-explainer ?schema)
(data-explainer ?schema options)
Like m/explainer
but output is pure clojure data. Schema objects have been replaced with their m/form.
Useful when you need to serialise errrors.
Like `m/explainer` but output is pure clojure data. Schema objects have been replaced with their m/form. Useful when you need to serialise errrors.
(dissoc ?schema key)
(dissoc ?schema key options)
Like [[clojure.core/dissoc]], but for EntrySchemas.
Like [[clojure.core/dissoc]], but for EntrySchemas.
(distinct-by f coll)
Returns a sequence of distinct (f x) values)
Returns a sequence of distinct (f x) values)
(explain-data ?schema value)
(explain-data ?schema value options)
Explains a value against a given schema. Like m/explain
but output is pure clojure data.
Schema objects have been replaced with their m/form
. Useful when you need to serialise errrors.
Creates the mu/data-explainer
for every call. When performance matters, (re-)use mu/data-explainer
instead.
Explains a value against a given schema. Like `m/explain` but output is pure clojure data. Schema objects have been replaced with their `m/form`. Useful when you need to serialise errrors. Creates the `mu/data-explainer` for every call. When performance matters, (re-)use `mu/data-explainer` instead.
(find ?schema k)
(find ?schema k options)
Like [[clojure.core/find]], but for EntrySchemas.
Like [[clojure.core/find]], but for EntrySchemas.
(find-first ?schema f)
(find-first ?schema f options)
Prewalks the Schema recursively with a 3-arity fn [schema path options], returns with and as soon as the function returns non-null value.
Prewalks the Schema recursively with a 3-arity fn [schema path options], returns with and as soon as the function returns non-null value.
(from-map-syntax m)
(from-map-syntax {:keys [type properties children] :as m} options)
(get ?schema k)
(get ?schema k default)
(get ?schema k default options)
Like [[clojure.core/get]], but for LensSchemas.
Like [[clojure.core/get]], but for LensSchemas.
(get-in ?schema ks)
(get-in ?schema ks default)
(get-in ?schema [k & ks] default options)
Like [[clojure.core/get-in]], but for LensSchemas.
Like [[clojure.core/get-in]], but for LensSchemas.
(in->paths schema in)
Returns a vector of schema paths for a given Schema and value path
Returns a vector of schema paths for a given Schema and value path
(keys ?schema)
Like [[clojure.core/keys]], but for EntrySchemas.
Like [[clojure.core/keys]], but for EntrySchemas.
(merge ?schema1 ?schema2)
(merge ?schema1 ?schema2 options)
Merges two schemas into one with the following rules:
nil
, the other one is used, regardless of value:merge-entries
fn is used (default last one wins):merge-default
fn is used (default last one wins)key | description |
---|---|
:merge-default | schema1 schema2 options -> schema fn to merge unknown entries |
:merge-required | boolean boolean -> boolean fn to resolve how required keys are merged |
Merges two schemas into one with the following rules: * if either schemas is `nil`, the other one is used, regardless of value * with two :map schemas, both keys and values are merged * for :and schemas, the first child is used in merge, rest kept as-is * with two :map entries, `:merge-entries` fn is used (default last one wins) * with any other schemas, `:merge-default` fn is used (default last one wins) | key | description | ------------------|------------- | `:merge-default` | `schema1 schema2 options -> schema` fn to merge unknown entries | `:merge-required` | `boolean boolean -> boolean` fn to resolve how required keys are merged
(open-schema ?schema)
(open-schema ?schema options)
Maps are implicitly open by default. They can be explicitly closed or
open by specifying the {:closed (true|false)}
property.
This function converts explicitly closed maps to implicitly open maps, recursively. Explicitly open maps are left untouched.
See closed-schema
Maps are implicitly open by default. They can be explicitly closed or open by specifying the `{:closed (true|false)}` property. This function converts explicitly closed maps to implicitly open maps, recursively. Explicitly open maps are left untouched. See [[closed-schema]]
(optional-keys ?schema)
(optional-keys ?schema ?keys)
(optional-keys ?schema keys options)
Makes map keys optional.
Makes map keys optional.
(path->in schema path)
Returns a value path for a given Schema and schema path
Returns a value path for a given Schema and schema path
(rename-keys ?schema kmap)
(rename-keys ?schema kmap options)
Like [[clojure.set/rename-keys]], but for EntrySchemas. Collisions are resolved in favor of the renamed key, like assoc
-ing.
Like [[clojure.set/rename-keys]], but for EntrySchemas. Collisions are resolved in favor of the renamed key, like `assoc`-ing.
(required-keys ?schema)
(required-keys ?schema ?keys)
(required-keys ?schema keys options)
Makes map keys required.
Makes map keys required.
(select-keys ?schema keys)
(select-keys ?schema keys options)
Like [[clojure.core/select-keys]], but for EntrySchemas.
Like [[clojure.core/select-keys]], but for EntrySchemas.
(subschemas ?schema)
(subschemas ?schema options)
Returns all subschemas for unique paths as a vector of maps with :schema, :path and :in keys. Walks over :schema references and top-level :refs. See [[malli.core/-walk]] for all options.
Returns all subschemas for unique paths as a vector of maps with :schema, :path and :in keys. Walks over :schema references and top-level :refs. See [[malli.core/-walk]] for all options.
(transform-entries ?schema f)
(transform-entries ?schema f options)
Transforms entries with f.
Transforms entries with f.
(union ?schema1 ?schema2)
(union ?schema1 ?schema2 options)
Union of two schemas. See merge
for more details.
Union of two schemas. See [[merge]] for more details.
(update schema key f & args)
Like [[clojure.core/update]], but for LensSchema instances.
Like [[clojure.core/update]], but for LensSchema instances.
(update-in schema ks f & args)
Like [[clojure.core/update-in]], but for LensSchemas.
Like [[clojure.core/update-in]], but for LensSchemas.
(update-properties ?schema f & args)
Returns a Schema instance with updated properties.
Returns a Schema instance with updated properties.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close