Liking cljdoc? Tell your friends :D

schema-tools.core


any-keysclj/s

(any-keys)
source

any-keyword-keysclj/s

(any-keyword-keys & schemas)
source

AnyKeysclj/s

source

AnyKeywordKeysclj/s

source

assocclj/s

(assoc schema & kvs)

Assoc[iate]s key & vals into Schema.

Assoc[iate]s key & vals into Schema.
sourceraw docstring

assoc-inclj/s

(assoc-in schema [k & ks] v)

Associates a value in a nested associative Schema, where ks is a sequence of keys and v is the new value and returns a new nested Schema. If any levels do not exist, hash-maps will be created.

Associates a value in a nested associative Schema, where `ks` is a
sequence of keys and `v` is the new value and returns a new nested Schema.
If any levels do not exist, hash-maps will be created.
sourceraw docstring

defaultclj/s

(default schema default)
source

dissocclj/s

(dissoc schema & ks)

Dissoc[iate]s keys from Schema.

Dissoc[iate]s keys from Schema.
sourceraw docstring

dissoc-inclj/s

(dissoc-in schema [k & ks])

Dissociates an entry from a nested associative Schema returning a new nested structure. keys is a sequence of keys. Any empty maps that result will not be present in the new Schema.

Dissociates an entry from a nested associative Schema returning a new
nested structure. keys is a sequence of keys. Any empty maps that result
will not be present in the new Schema.
sourceraw docstring

get-inclj/s

(get-in m ks)
(get-in m ks not-found)

Returns the value in a nested associative Schema, where ks is a sequence of keys. Returns nil if the key is not present, or the not-found value if supplied.

Returns the value in a nested associative Schema,
where `ks` is a sequence of keys. Returns `nil` if the key
is not present, or the `not-found` value if supplied.
sourceraw docstring

mergeclj/s

(merge & schemas)

Returns a Schema that consists of the rest of the Schemas conj-ed onto the first. If a schema key occurs in more than one map, the mapping from the latter (left-to-right) will be the mapping in the result. Works only with Map schemas.

Returns a Schema that consists of the rest of the Schemas conj-ed onto
the first. If a schema key occurs in more than one map, the mapping from
the latter (left-to-right) will be the mapping in the result. Works only
with Map schemas.
sourceraw docstring

open-schemaclj/s

(open-schema schema)

Walks a schema adding [s/Any s/Any] entry to all Map Schemas, removing any existing extra keys if defined.

Walks a schema adding [`s/Any` `s/Any`] entry to all Map Schemas, removing any
existing extra keys if defined.
sourceraw docstring

optional-keysclj/s

(optional-keys m)
(optional-keys m ks)

Makes given map keys optional. Defaults to all keys.

Makes given map keys optional. Defaults to all keys.
sourceraw docstring

optional-keys-schemaclj/s

(optional-keys-schema schema)

Walks a schema making all keys optional in Map Schemas.

Walks a schema making all keys optional in Map Schemas.
sourceraw docstring

required-keysclj/s

(required-keys m)
(required-keys m ks)

Makes given map keys required. Defaults to all keys.

Makes given map keys required. Defaults to all keys.
sourceraw docstring

resolve-schemaclj

(resolve-schema schema)

Returns the schema var if the schema contains the :name and :ns definitions (set by schema.core/defschema).

Returns the schema var if the schema contains the `:name` and `:ns`
definitions (set by `schema.core/defschema`).
sourceraw docstring

resolve-schema-descriptionclj

(resolve-schema-description schema)

Returns the schema description, in this lookup order: a) schema meta :description b) schema var meta :doc if not "" c) nil

Returns the schema description, in this lookup order:
a) schema meta :description
b) schema var meta :doc if not ""
c) nil
sourceraw docstring

Schemacljs

source

schemaclj/s

(schema pred)
(schema pred data)
source

schema-descriptionclj/s

(schema-description schema)

Returns the description of a schema attached via schema-with-description.

Returns the description of a schema attached via schema-with-description.
sourceraw docstring

schema-valueclj/s

(schema-value s)

Returns the sub-schema or sub-schemas of given schema.

Returns the sub-schema or sub-schemas of given schema.
sourceraw docstring

schema-with-descriptionclj/s

(schema-with-description schema description)

Records description in schema's metadata.

Records description in schema's metadata.
sourceraw docstring

select-keysclj/s

(select-keys schema ks)

Like clojure.core/select-keys but handles boths optional-keys and required-keys.

Like `clojure.core/select-keys` but handles boths optional-keys and required-keys.
sourceraw docstring

select-schemaclj/s

(select-schema value schema)
(select-schema value schema matcher)

Strips all disallowed keys from nested Map schemas via coercion. Takes an optional coercion matcher for extra coercing the selected value(s) on a single sweep. If a value can't be coerced to match the schema ExceptionInfo is thrown (like schema.core/validate).

Strips all disallowed keys from nested Map schemas via coercion. Takes an optional
coercion matcher for extra coercing the selected value(s) on a single sweep. If a value
can't be coerced to match the schema `ExceptionInfo` is thrown (like `schema.core/validate`).
sourceraw docstring

updateclj/s

(update schema k f & args)

Updates a value in a map with a function.

Updates a value in a map with a function.
sourceraw docstring

update-inclj/s

(update-in schema [k & ks] f & args)

'Updates' a value in a nested associative Schema, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested Schema. If any levels do not exist, hash-maps will be created.

'Updates' a value in a nested associative Schema, where `ks` is a
sequence of keys and `f` is a function that will take the old value
and any supplied args and return the new value, and returns a new
nested Schema. If any levels do not exist, hash-maps will be
created.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close