(wrap-single-model-validate f)validates input according to model
(pipeline/normalise {:account/name "Chris"} {:schema (schema/schema examples/account-name-age-sex) :pipeline {:validate {:account {:name number?}}}} wrappers) => (throws-info {:not-validated true :nsv [:account :name]})
(pipeline/normalise {:account/name "Bob"} {:schema (schema/schema examples/account-name-age-sex) :pipeline {:validate {:account {:name #(= % "Bob")}}}} wrappers) => {:account {:name "Bob"}}
validates input according to model
(pipeline/normalise {:account/name "Chris"}
{:schema (schema/schema examples/account-name-age-sex)
:pipeline {:validate {:account {:name number?}}}}
*wrappers*)
=> (throws-info {:not-validated true :nsv [:account :name]})
(pipeline/normalise {:account/name "Bob"}
{:schema (schema/schema examples/account-name-age-sex)
:pipeline {:validate {:account {:name #(= % "Bob")}}}}
*wrappers*)
=> {:account {:name "Bob"}}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 |