Data Specs
Data Specs
(spec {data :spec name :name nested? :spec-tools.data-spec/nested? :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 is a website building & hosting documentation for Clojure/Script libraries
× close