Liking cljdoc? Tell your friends :D

livadator.core

Schema-driven validation entails that each structure can incorporate yet another validating structure.

Schema-driven validation entails that each structure can incorporate yet another validating structure.
raw docstring

-validate-excess-fieldsclj

(-validate-excess-fields coll schema options)
source

erroneous?cljmacro

(erroneous? data action otherwise)
source

find-schemaclj

(find-schema alias)

Finds schema in schema registry

Finds `schema` in schema registry
sourceraw docstring

register-schemaclj

(register-schema alias schema)

Register schema in a registry, it then can be access via provided alias

Register `schema` in a registry, it then can be access via provided `alias`
sourceraw docstring

reset-schemasclj

(reset-schemas)
source

schema-schemaclj

source

unregister-schemaclj

(unregister-schema alias)

Unregisters schema from registry making it unavailable

Unregisters `schema` from registry making it unavailable
sourceraw docstring

valid?clj

(valid? coll schema)

Quickly tests if provided col is valid, schema can be alias

Quickly tests if provided `col` is valid, schema can be alias
sourceraw docstring

validateclj

(validate coll schema)
(validate coll schema options)

Validates provided structure against schema. Schema can be alias. Returns a map of keys that are erroneous.

Example

(validate {:key [0 1 2 3]} {:key int?}))
;=>
{}

(validate {:key [0 1 2 3 false]} {:key int?})
;=>
{:key [{:value false :validators [0]}]}

(validate :invalid {:validators (fn [value] (str "this value is " (name value)))})
;=>
{:value :invalid :validators ["this value is invalid"]}

See also: validate-schema

Validates provided structure against `schema`. Schema can be alias. Returns a map of keys that are erroneous.

**Example**

```clojure
(validate {:key [0 1 2 3]} {:key int?}))
;=>
{}

(validate {:key [0 1 2 3 false]} {:key int?})
;=>
{:key [{:value false :validators [0]}]}

(validate :invalid {:validators (fn [value] (str "this value is " (name value)))})
;=>
{:value :invalid :validators ["this value is invalid"]}
```

See also: [[validate-schema]]
sourceraw docstring

validate-schemaclj

(validate-schema schema)

Validates provided schema for correctness. Returns a map of keys that are erroneous.

Example


(validate-schema {:key int?})
;=>
{}

(validate-schema {:key {:required? :invalid-value :validators []}})
;=>
{:key {:required? {:validators [0] :value :invalid-value}}}

See also: validate

Validates provided schema for correctness. Returns a map of keys that are erroneous.

**Example**
```clojure

(validate-schema {:key int?})
;=>
{}

(validate-schema {:key {:required? :invalid-value :validators []}})
;=>
{:key {:required? {:validators [0] :value :invalid-value}}}
```

See also: [[validate]]
sourceraw docstring

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

× close