Data Specs
Data Specs
(spec {data :spec name :name :as opts})(spec name data)Creates a clojure.spec.alpha/Spec out of a data-spec. Supports 2 arities:
;; arity1 (ds/spec {:spec {:i int?} :name ::map})
;; arity2 (legacy) (ds/spec ::map {:i int?})
The following options are valid for the 1 arity case:
:spec the data-spec form (required)
:name fully qualified keyword name for the spec, used in keys-spec
key spec registration, required if there are non-qualified
keyword keys in maps.
:keys-spec function to generate keys-spec (default: [[keys-spec]])
:keys-default optional function to wrap the plain keyword keys, e.g. setting
the value to [[opt]] maes all plain keyword keys optional.
Creates a clojure.spec.alpha/Spec out of a data-spec. Supports 2 arities:
;; arity1
(ds/spec
{:spec {:i int?}
:name ::map})
;; arity2 (legacy)
(ds/spec ::map {:i int?})
The following options are valid for the 1 arity case:
:spec the data-spec form (required)
:name fully qualified keyword name for the spec, used in keys-spec
key spec registration, required if there are non-qualified
keyword keys in maps.
:keys-spec function to generate keys-spec (default: [[keys-spec]])
:keys-default optional function to wrap the plain keyword keys, e.g. setting
the value to [[opt]] maes all plain keyword keys optional.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 |