(assoc-meta spec k x)
Assoc k
->x
on metadata for spec
Assoc `k`->`x` on metadata for `spec`
Find first description
value in spec hierarchy for spec
Find first `description` value in spec hierarchy for spec
Find first format
value in spec hierarchy for spec
Find first `format` value in spec hierarchy for spec
Find first $id
value in spec hierarchy for spec
Find first `$id` value in spec hierarchy for spec
Find first pattern
value in spec hierarchy for spec
Find first `pattern` value in spec hierarchy for spec
Find first schema
value in spec hierarchy for spec
Find first `schema` value in spec hierarchy for spec
Find first title
value in spec hierarchy for spec
Find first `title` value in spec hierarchy for spec
(json-schema k
&
{:as opts
:keys [property-key-fn strict gen-only-first-and-arg
unknown-spec-default]})
Generate json-schema for spec
.
opts
support:
property-key-fn
- function that will convert the spec keys to json-schema
keys - defaults to name
strict
- whether to throw or not upon encountering unknown values for
conversion - defaults to true
gen-only-first-and-arg
- whether to only attempt generate the first
predicate of s/and
- defaults to false
unknown-spec-default
- value to be used for unknown values for conversion
nil
Generate json-schema for `spec`. `opts` support: * `property-key-fn` - function that will convert the spec keys to json-schema keys - defaults to `name` * `strict` - whether to throw or not upon encountering unknown values for conversion - defaults to `true` * `gen-only-first-and-arg` - whether to only attempt generate the first predicate of `s/and` - defaults to `false` * `unknown-spec-default` - value to be used for unknown values for conversion - defaults to `nil`
(register-form! form f)
Registers a form
for generation. Upon encountering that form (by matching its
against first element or sequential symbolic spec values), json-schema
will
then call f
against its arguments for generation
Registers a `form` for generation. Upon encountering that form (by matching its against first element or sequential symbolic spec values), `json-schema` will then call `f` against its arguments for generation
(register-ident! ident x)
Registers an ident
for generation. Upon encountering a qualified
symbol/keyword matching an ident
in the registry it will return x
as
generated value
Registers an `ident` for generation. Upon encountering a qualified symbol/keyword matching an `ident` in the registry it will return `x` as generated value
(register-pred! k schema-fn)
(register-pred! k schema-fn _opts)
Sets conformer
and schema-fn
for predicate parser.
If a conformer matches, the bindings we get from the s/conform result will be
passed to schema-fn
in order to generate an appropriate json-schema value
for the predicate.
Sets `conformer` and `schema-fn` for predicate parser. If a conformer matches, the bindings we get from the s/conform result will be passed to `schema-fn` in order to generate an appropriate json-schema value for the predicate.
(vary-meta k f & args)
Like clojure.core/vary-meta but on spec
k` metadata
Like `clojure.core/vary-meta but on spec `k` metadata
(with-description k description)
Add description
to spec
Add `description` to spec
(with-format k fmt)
Add format
to spec.
See https://json-schema.org/understanding-json-schema/reference/string#built-in-formats
Add `format` to spec. See https://json-schema.org/understanding-json-schema/reference/string#built-in-formats
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close