(wrap-single-type-check f)wraps normalise to type check inputs as well as to coerce incorrect inputs (pipeline/normalise {:account {:age "10"}} {:schema (schema/schema examples/account-name-age-sex)} {:normalise-single [wrap-single-type-check]}) => (throws-info {:type :long, :data "10", :wrong-type true})
(pipeline/normalise {:account {:age "10"}} {:schema (schema/schema examples/account-name-age-sex) :options {:use-coerce true}} {:normalise-single [wrap-single-type-check]}) => {:account {:age 10}}
wraps normalise to type check inputs as well as to coerce incorrect inputs
(pipeline/normalise {:account {:age "10"}}
{:schema (schema/schema examples/account-name-age-sex)}
{:normalise-single [wrap-single-type-check]})
=> (throws-info {:type :long,
:data "10",
:wrong-type true})
(pipeline/normalise {:account {:age "10"}}
{:schema (schema/schema examples/account-name-age-sex)
:options {:use-coerce true}}
{:normalise-single [wrap-single-type-check]})
=> {:account {:age 10}}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 |