Liking cljdoc? Tell your friends :D

json-schema.infer


eradicate-listsclj

(eradicate-lists m)
source

inferclj

(infer params & docs)

Schema inference from multiple documents of associative data. Takes n sample documents as input, and returns a schema that allows only data represented in at least one of the documents.

Data that is present in all documents will be required. Data only represented in a subset of documents will be optional. Data not represented at all, will not be allowed.

If a single document is passed, infer-strict is used directly.

Params: title - schema title description - schema description uri - schema uri schema - continue building on schema optional - keys that shouldn't be required nullable - optionality by nullability

Schema inference from multiple documents of associative data.
Takes n sample documents as input, and returns a schema that allows only
data represented in at least one of the documents.

Data that is present in all documents will be required.
Data only represented in a subset of documents will be optional.
Data not represented at all, will not be allowed.

If a single document is passed, infer-strict is used directly.

Params:
  title       - schema title
  description - schema description
  uri         - schema uri
  schema      - continue building on schema
  optional    - keys that shouldn't be required
  nullable    - optionality by nullability
sourceraw docstring

infer->jsonclj

(infer->json params data)

A helper function that returns inferred schema as JSON

A helper function that returns inferred schema as JSON
sourceraw docstring

infer-strictclj

(infer-strict {:keys [title schema optional] :as params} data)

Naive but strict schema inference from associative data. Strict in the sense that everything is required, and nothing else is allowed.

Params: optional - keys that shouldn't be required

Optional params: title - schema title description - schema description uri - schema uri schema - continue building on schema

Naive but strict schema inference from associative data.
Strict in the sense that everything is required, and nothing
else is allowed.

Params:
  optional    - keys that shouldn't be required

Optional params:
  title       - schema title
  description - schema description
  uri         - schema uri
  schema      - continue building on schema
sourceraw docstring

key-pathsclj

(key-paths m)

Returns a sequence of all key paths in a given map using DFS walk. Converts lists to vectors to enable associative lookup.

Based on code from: https://dnaeon.github.io/clojure-map-ks-paths/

Returns a sequence of all key paths in a given map using DFS walk.
Converts lists to vectors to enable associative lookup.

Based on code from:
https://dnaeon.github.io/clojure-map-ks-paths/
sourceraw docstring

sanitize-keyclj

(sanitize-key k)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close