Shared infrastructure for doc-format renderers (OpenAPI, markdown, ...). Describes the expected shape of a route/doc spec and provides helpers that are format-agnostic.
Shared infrastructure for doc-format renderers (OpenAPI, markdown, ...). Describes the expected shape of a route/doc spec and provides helpers that are format-agnostic.
(describe spec-or-schema)Walks spec-or-schema and returns a seq of maps, one per reachable field
path:
{:path <path-string> :type <type> :default <if any> :required <bool> :description <if any>}
Paths use the c3kit.apron.schema.path grammar (see SCHEMA.md 'Path
Traversal'). A :map's declared fields are walked by name; its dynamic
:key-spec / :value-spec (when present) are reported at the .key /
.value template segments. A :seq's entry :spec is reported at .value
-- schemas have no concrete index to report against, only data does.
:one-of specs are reported as a single entry at their own path; the path grammar has no segment for 'which alternative', so the individual :specs are not expanded into separate entries.
spec-or-schema may be a bare schema (a map of field name -> spec, the
form passed to coerce/validate/conform) or a wrapped spec (e.g.
{:type :map :schema {...}}); either way only its fields are described --
there's no path for the root itself. Pure data in, pure data out: no
function in the schema (:coerce, :validate, ...) is ever called.
Walks `spec-or-schema` and returns a seq of maps, one per reachable field
path:
{:path <path-string> :type <type> :default <if any> :required <bool> :description <if any>}
Paths use the c3kit.apron.schema.path grammar (see SCHEMA.md 'Path
Traversal'). A :map's declared fields are walked by name; its dynamic
:key-spec / :value-spec (when present) are reported at the `.key` /
`.value` template segments. A :seq's entry :spec is reported at `.value`
-- schemas have no concrete index to report against, only data does.
:one-of specs are reported as a single entry at their own path; the path
grammar has no segment for 'which alternative', so the individual :specs
are not expanded into separate entries.
`spec-or-schema` may be a bare schema (a map of field name -> spec, the
form passed to coerce/validate/conform) or a wrapped spec (e.g.
{:type :map :schema {...}}); either way only its fields are described --
there's no path for the root itself. Pure data in, pure data out: no
function in the schema (:coerce, :validate, ...) is ever called.(integer-keys? m)(maybe-invalid-doc spec)(required-fields schema)(required? {:keys [validate validations required]})(schema-map? m)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 |