(coerce value schema)
(coerce value schema matcher)
(coerce value schema matcher type)
Simultaneously coerces and validates a value to match the given schema.
If a value
can't
be coerced to match the schema
, an ex-info
is thrown - like schema.core/validate
,
but with overridable :type
, defaulting to :schema-tools.coerce/error.
Simultaneously coerces and validates a value to match the given `schema.` If a `value` can't be coerced to match the `schema`, an `ex-info` is thrown - like `schema.core/validate`, but with overridable `:type`, defaulting to `:schema-tools.coerce/error.`
(coercer schema)
(coercer schema matcher)
(coercer schema matcher type)
Produce a function that simultaneously coerces and validates a value against a schema.
If a value can't be coerced to match the schema, an ex-info
is thrown - like schema.core/validate
,
but with overridable :type
, defaulting to :schema-tools.coerce/error.
Produce a function that simultaneously coerces and validates a value against a `schema.` If a value can't be coerced to match the schema, an `ex-info` is thrown - like `schema.core/validate`, but with overridable `:type`, defaulting to `:schema-tools.coerce/error.`
Deprecated - use default-value-matcher
instead.
Deprecated - use [[default-value-matcher]] instead.
(default-key-matcher schema)
Creates a matcher which adds missing keys to a map if they have default values.
You can set default values with schema-tools.core/default
.
Creates a matcher which adds missing keys to a map if they have default values. You can set default values with [[schema-tools.core/default]].
(default-matcher schema)
Combination of default-value-matcher
and default-key-matcher
: Creates
a matcher which adds missing keys with default values to a map and converts
nils to default values. You can set default values with
schema-tools.core/default
.
Combination of [[default-value-matcher]] and [[default-key-matcher]]: Creates a matcher which adds missing keys with default values to a map and converts nils to default values. You can set default values with [[schema-tools.core/default]].
(default-value-matcher schema)
Creates a matcher which converts nils to default values. You can set default values
with schema-tools.core/default
.
Creates a matcher which converts nils to default values. You can set default values with [[schema-tools.core/default]].
(map-filter-matcher schema)
Creates a matcher which removes all illegal keys from non-record maps.
Creates a matcher which removes all illegal keys from non-record maps.
(multi-matcher accept-schema accept-value fs)
Creates a matcher for (accept-schema schema), reducing value with fs functions if (accept-value value).
Creates a matcher for (accept-schema schema), reducing value with fs functions if (accept-value value).
(or-matcher & matchers)
Creates a matcher where the first matcher matching the given schema is used.
Creates a matcher where the first matcher matching the given schema is used.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close