Liking cljdoc? Tell your friends :D

c3kit.apron.schema.doc

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.
raw docstring

describeclj/s

(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.
raw docstring

doc-schemaclj/s


integer-keys?clj/s

(integer-keys? m)

maybe-invalid-docclj/s

(maybe-invalid-doc spec)

nil?-or-map?clj/s


required-fieldsclj/s

(required-fields schema)

required?clj/s

(required? {:keys [validate validations required]})

route-schemaclj/s


schema-map?clj/s

(schema-map? m)

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close