(proto-spec obj)(proto-spec obj {:keys [rename replacements refinements generators]})Generate specs corresponding to an Proto schema. Note that all named types mut be generated separately as a top-level call to prevent them from clobbering one another.
Optional keyword arguments:
:rename - A namespaced keyword with which to replace the Proto schema name.
:refinements - A map of spec names to a spec or predicate. These are combined with the base spec using clojure.spec/and.
:replacements - A map of spec names to a spec. This will completely replace the base spec.
:generators - A map of spec names to generator functions. This will provide a custom generator for a spec type to better model the domain.
Generate specs corresponding to an Proto schema. Note that all named
types mut be generated separately as a top-level call to prevent
them from clobbering one another.
Optional keyword arguments:
:rename - A namespaced keyword with which to replace the Proto
schema name.
:refinements - A map of spec names to a spec or predicate. These are
combined with the base spec using clojure.spec/and.
:replacements - A map of spec names to a spec. This will completely
replace the base spec.
:generators - A map of spec names to generator functions. This will
provide a custom generator for a spec type to better
model the domain.(refine-with spec-map)Given a map of spec name to specs, refine the specs.
Given a map of spec name to specs, refine the specs.
(spec-kw n)(spec-kw ns n)Create a keyword appropriate for use as a spec name.
Examples:
Create a keyword appropriate for use as a spec name. Examples: - (spec-kw "a.b.c.d") => :a.b.c./d - (spec-kw :ns "name") => :ns/name
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 |