Liking cljdoc? Tell your friends :D
All platforms.

malli.core


-=>-schemaclj/s

(-=>-schema)
source

-and-schemaclj/s

(-and-schema)
source

-any-schemaclj/s

(-any-schema)
source

-astclj/s

(-ast acc properties options)
source

-ast?clj/s

(-ast? x)
source

-boolean-fnclj/s

(-boolean-fn x)
source

-boolean-schemaclj/s

(-boolean-schema)
source

-cachedclj/s

(-cached s k f)
source

-cached?clj/s

(-cached? x)
source

-check-children!clj/s

(-check-children! type properties children props)
(-check-children! type properties children min max)
source

-collection-schemaclj/s

(-collection-schema ?props)
source

-collection-transformerclj/s

(-collection-transformer t empty)
source

-compclj/s≠

clj
(-comp)
(-comp f)
(-comp f g)
(-comp f g h)
(-comp f1 f2 f3 f4)
(-comp f1 f2 f3 f4 f5)
(-comp f1 f2 f3 f4 f5 f6)
(-comp f1 f2 f3 f4 f5 f6 f7)
(-comp f1 f2 f3 f4 f5 f6 f7 f8)
(-comp f1 f2 f3 f4 f5 f6 f7 f8 & fs)
cljs
(-comp)
(-comp f)
(-comp f g)
(-comp f g h)
(-comp f1 f2 f3 & fs)
source

-create-cacheclj/s

(-create-cache _options)
source

-create-entry-formclj/s

(-create-entry-form parent properties entry-parser options)
source

-create-entry-parserclj/s

(-create-entry-parser ?children props options)
source

-create-formclj/s

(-create-form type properties children options)
source

-default-sci-optionsclj/s

(-default-sci-options)
source

-delayed-registryclj/s

(-delayed-registry m f)
source

-deprecated!clj/s

(-deprecated! x)
source

-deregister-function-schemas!clj/s

(-deregister-function-schemas! key)
source

-deregister-metadata-function-schemas!clj/s

(-deregister-metadata-function-schemas! key)
source

-double-schemaclj/s

(-double-schema)
source

-eager-entry-parserclj/s

(-eager-entry-parser children props options)
source

-entry-astclj/s

(-entry-ast schema keyset)
source

-entry-parser?clj/s

(-entry-parser? x)
source

-entry-schema?clj/s

(-entry-schema? x)
source

-enum-schemaclj/s

(-enum-schema)
source

-equalsclj/s

(-equals x y)
source

-fail!clj/s

(-fail! type)
(-fail! type data)
source

-fn-schemaclj/s

(-fn-schema)
source

-from-child-astclj/s

(-from-child-ast parent ast options)
source

-from-entry-astclj/s

(-from-entry-ast parent ast options)
source

-from-type-astclj/s

(-from-type-ast parent ast options)
source

-from-value-astclj/s

(-from-value-ast parent ast options)
source

-function-infoclj/s

(-function-info schema)
source

-function-schemaclj/s

(-function-schema _)
source

-get-entriesclj/s

(-get-entries schema key default)
source

-group-by-arity!clj/s

(-group-by-arity! infos)
source

-guardclj/s

(-guard pred tf)
source

-inner-entriesclj/s

(-inner-entries walker path entries options)
source

-inner-indexedclj/s

(-inner-indexed walker path children options)
source

-instrumentclj/s

(-instrument props)
(-instrument props f)
(-instrument {:keys [scope report gen]
              :or {scope #{:output :input} report -fail!}
              :as props}
             f
             options)

Takes an instrumentation properties map and a function and returns a wrapped function, which will validate function arguments and return values based on the function schema definition. The following properties are used:

keydescription
:schemafunction schema
:scopeoptional set of scope definitions, defaults to #{:input :output}
:reportoptional side-effecting function of key data -> any to report problems, defaults to m/-fail!
:genoptional function of schema -> schema -> value to be invoked on the args to get the return value
Takes an instrumentation properties map and a function and returns a wrapped function,
which will validate function arguments and return values based on the function schema
definition. The following properties are used:

| key       | description |
| ----------|-------------|
| `:schema` | function schema
| `:scope`  | optional set of scope definitions, defaults to `#{:input :output}`
| `:report` | optional side-effecting function of `key data -> any` to report problems, defaults to `m/-fail!`
| `:gen`    | optional function of `schema -> schema -> value` to be invoked on the args to get the return value
sourceraw docstring

-int-schemaclj/s

(-int-schema)
source

-interceptingclj/s

(-intercepting interceptor)
(-intercepting {:keys [enter leave]} f)
source

-into-transformerclj/s

(-into-transformer x)
source

-keyword->stringclj/s

(-keyword->string x)
source

-keyword-schemaclj/s

(-keyword-schema)
source

-lazyclj/s

(-lazy ref options)
source

-lazy-entry-parserclj/s

(-lazy-entry-parser ?children props options)
source

-map-of-schemaclj/s

(-map-of-schema)
source

-map-schemaclj/s

(-map-schema)
(-map-schema opts)
source

-map-transformerclj/s

(-map-transformer ts)
source

-maybe-schemaclj/s

(-maybe-schema)
source

-memoizeclj/s

(-memoize f)
source

-min-max-predclj/s

(-min-max-pred f)
source

-multi-schemaclj/s

(-multi-schema)
(-multi-schema opts)
source

-nil-schemaclj/s

(-nil-schema)
source

-not-schemaclj/s

(-not-schema)
source

-or-schemaclj/s

(-or-schema)
source

-orn-schemaclj/s

(-orn-schema)
source

-parent-children-transformerclj/s

(-parent-children-transformer parent children transformer method options)
source

-parse-entry-astclj/s

(-parse-entry-ast ast options)
source

-pointerclj/s

(-pointer id schema options)
source

-properties-and-optionsclj/s

(-properties-and-options properties options f)
source

-property-registryclj/s

(-property-registry m options f)
source

-qualified-keyword-predclj/s

(-qualified-keyword-pred properties)
source

-qualified-keyword-schemaclj/s

(-qualified-keyword-schema)
source

-qualified-symbol-schemaclj/s

(-qualified-symbol-schema)
source

-re-schemaclj/s

(-re-schema class?)
source

-ref-schemaclj/s

(-ref-schema)
(-ref-schema {:keys [lazy type-properties]})
source

-ref-schema?clj/s

(-ref-schema? x)
source

-reference?clj/s

(-reference? ?schema)
source

-register-function-schema!clj/s

(-register-function-schema! ns name ?schema data)
(-register-function-schema! ns name ?schema data key f)
source

-registryclj/s≠

clj
(-registry)
(-registry {:keys [registry]})
cljs
(-registry)
(-registry opts)
source

-safe-predclj/s

(-safe-pred f)
source

-schema-schemaclj/s

(-schema-schema {:keys [id raw]})
source

-sequence-entry-schemaclj/s

(-sequence-entry-schema {:keys [type re-validator re-explainer re-parser
                                re-unparser re-transformer re-min-max]
                         {:keys [min max]} :child-bounds
                         :as opts})
source

-sequence-schemaclj/s

(-sequence-schema {:keys [type re-validator re-explainer re-parser re-unparser
                          re-transformer re-min-max]
                   {:keys [min max]} :child-bounds})
source

-set-assoc-childrenclj/s

(-set-assoc-children schema key value)
source

-set-childrenclj/s

(-set-children schema children)
source

-set-entriesclj/s

(-set-entries schema ?key value)
source

-set-propertiesclj/s

(-set-properties schema properties)
source

-simple-entry-parserclj/s

(-simple-entry-parser keyset children forms)
source

-simple-formclj/s

(-simple-form parent properties children f options)
source

-simple-schemaclj/s

(-simple-schema ?props)
source

-string-schemaclj/s

(-string-schema)
source

-symbol-schemaclj/s

(-symbol-schema)
source

-to-child-astclj/s

(-to-child-ast schema)
source

-to-type-astclj/s

(-to-type-ast schema)
source

-to-value-astclj/s

(-to-value-ast schema)
source

-transformer?clj/s

(-transformer? x)
source

-tuple-schemaclj/s

(-tuple-schema)
source

-tuple-transformerclj/s

(-tuple-transformer ts)
source

-unlift-keysclj/s

(-unlift-keys m prefix)
source

-updateclj/s

(-update x k f)
source

-update-optionsclj/s

(-update-options schema f)
source

-uuid-schemaclj/s

(-uuid-schema)
source

-val-schemaclj/s

(-val-schema)
(-val-schema schema properties)
source

-validate-limitsclj/s

(-validate-limits min max)
source

-vmapclj/s

(-vmap os)
(-vmap f os)
source

-walk-entriesclj/s

(-walk-entries schema walker path options)
source

-walk-indexedclj/s

(-walk-indexed schema walker path options)
source

-walk-leafclj/s

(-walk-leaf schema walker path options)
source

=>clj/smacro

(=> name value)
source

ASTclj/sprotocol

-from-astclj/s

(-from-ast this ast options)

ast to schema

ast to schema

-to-astclj/s

(-to-ast this options)

schema to ast

schema to ast
source

astclj/s

(ast ?schema)
(ast ?schema options)

Returns the Schema AST

Returns the Schema AST
sourceraw docstring

base-schemasclj/s

(base-schemas)
source

Cachedclj/sprotocol

-cacheclj/s

(-cache this)
source

childrenclj/s

(children ?schema)
(children ?schema options)

Returns the Schema children with all Child Schemas resolved. For MapEntry Schemas, returns a always tuple3 of key ?properties child

Returns the Schema children with all Child Schemas resolved. For
`MapEntry` Schemas, returns a always tuple3 of `key ?properties child`
sourceraw docstring

children-schemaclj/s

(children-schema ?schema)
(children-schema ?schema options)

Returns children schema for Schema or IntoSchema.

Returns children schema for Schema or IntoSchema.
sourceraw docstring

class-schemasclj/s

(class-schemas)
source

comparator-schemasclj/s

(comparator-schemas)
source

decodeclj/s

(decode ?schema value t)
(decode ?schema value options t)

Transforms a value with a given decoding transformer against a schema.

Transforms a value with a given decoding transformer against a schema.
sourceraw docstring

decoderclj/s

(decoder ?schema t)
(decoder ?schema options t)

Creates a value decoding function given a transformer and a schema.

Creates a value decoding function given a transformer and a schema.
sourceraw docstring

default-registryclj/s

source

default-schemasclj/s

(default-schemas)
source

derefclj/s

(deref ?schema)
(deref ?schema options)

Derefs top-level RefSchemas or returns original Schema.

Derefs top-level `RefSchema`s or returns original Schema.
sourceraw docstring

deref-allclj/s

(deref-all ?schema)
(deref-all ?schema options)

Derefs top-level RefSchemas recursively or returns original Schema.

Derefs top-level `RefSchema`s recursively or returns original Schema.
sourceraw docstring

encodeclj/s

(encode ?schema value t)
(encode ?schema value options t)

Transforms a value with a given encoding transformer against a schema.

Transforms a value with a given encoding transformer against a schema.
sourceraw docstring

encoderclj/s

(encoder ?schema t)
(encoder ?schema options t)

Creates a value encoding transformer given a transformer and a schema.

Creates a value encoding transformer given a transformer and a schema.
sourceraw docstring

entriesclj/s

(entries ?schema)
(entries ?schema options)

Returns EntrySchema children as a sequence of clojure.lang/MapEntrys where the values child schemas wrapped in :malli.core/val Schemas, with the entry properties as properties.

Using entries enable usage of entry properties in walking and value transformation.

(def schema [:map [:x int?] [:y {:optional true} int?]])

(m/children schema) ; [[:x nil int?] ; [:y {:optional true} int?]]

(m/entries schema) ; [[:x [:malli.core/val int?]] ; [:y [:malli.core/val {:optional true} int?]]]

(map key (m/entries schema)) ; (:x :y)

Returns `EntrySchema` children as a sequence of `clojure.lang/MapEntry`s
where the values child schemas wrapped in `:malli.core/val` Schemas,
with the entry properties as properties.

Using `entries` enable usage of entry properties in walking and value
transformation.

   (def schema
     [:map
      [:x int?]
      [:y {:optional true} int?]])

   (m/children schema)
   ; [[:x nil int?]
   ;  [:y {:optional true} int?]]

   (m/entries schema)
   ; [[:x [:malli.core/val int?]]
   ;  [:y [:malli.core/val {:optional true} int?]]]

   (map key (m/entries schema))
   ; (:x :y)
sourceraw docstring

EntryParserclj/sprotocol

-entry-childrenclj/s

(-entry-children this)

-entry-entriesclj/s

(-entry-entries this)

-entry-formsclj/s

(-entry-forms this)

-entry-keysetclj/s

(-entry-keyset this)
source

EntrySchemaclj/sprotocol

-entriesclj/s

(-entries this)

returns sequence of key -val-schema entries

returns sequence of `key -val-schema` entries

-entry-parserclj/s

(-entry-parser this)
source

evalclj/s

(eval ?code)
(eval ?code options)
source

explainclj/s

(explain ?schema value)
(explain ?schema value options)

Explains a value against a given schema. Creates the explainer for every call. When performance matters, (re-)use explainer instead.

Explains a value against a given schema. Creates the `explainer` for every call.
When performance matters, (re-)use `explainer` instead.
sourceraw docstring

explainerclj/s

(explainer ?schema)
(explainer ?schema options)

Returns an pure explainer function of type x -> explanation for a given Schema. Caches the result for Cached Schemas with key :explainer.

Returns an pure explainer function of type `x -> explanation` for a given Schema.
Caches the result for [[Cached]] Schemas with key `:explainer`.
sourceraw docstring

formclj/s

(form ?schema)
(form ?schema options)

Returns the Schema form

Returns the Schema form
sourceraw docstring

from-astclj/s

(from-ast ?ast)
(from-ast ?ast options)

Creates a Schema from AST

Creates a Schema from AST
sourceraw docstring

function-schemaclj/s

(function-schema ?schema)
(function-schema ?schema options)
source

function-schemasclj/s

(function-schemas)
(function-schemas key)
source

into-schemaclj/s

(into-schema type properties children)
(into-schema type properties children options)

Creates a Schema instance out of type, optional properties map and children

Creates a Schema instance out of type, optional properties map and children
sourceraw docstring

into-schema?clj/s

(into-schema? x)

Checks if x is a IntoSchema instance

Checks if x is a IntoSchema instance
sourceraw docstring

IntoSchemaclj/sprotocol

-children-schemaclj/s

(-children-schema this options)

maybe returns sequence schema describing schema children

maybe returns sequence schema describing schema children

-into-schemaclj/s

(-into-schema this properties children options)

creates a new schema instance

creates a new schema instance

-properties-schemaclj/s

(-properties-schema this options)

maybe returns :map schema describing schema properties

maybe returns :map schema describing schema properties

-typeclj/s

(-type this)

returns type of the schema

returns type of the schema

-type-propertiesclj/s

(-type-properties this)

returns schema type properties

returns schema type properties
source

LensSchemaclj/sprotocol

-getclj/s

(-get this key default)

returns schema at key

returns schema at key

-keepclj/s

(-keep this)

returns truthy if schema contributes to value path

returns truthy if schema contributes to value path

-setclj/s

(-set this key value)

returns a copy with key having new value

returns a copy with key having new value
source

optionsclj/s

(options ?schema)
(options ?schema options)

Returns options used in creating the Schema

Returns options used in creating the Schema
sourceraw docstring

parentclj/s

(parent ?schema)
(parent ?schema options)

Returns the IntoSchema instance that created the Schema

Returns the IntoSchema instance that created the Schema
sourceraw docstring

parseclj/s

(parse ?schema value)
(parse ?schema value options)

parses a value against a given schema. Creates the parser for every call. When performance matters, (re-)use parser instead.

parses a value against a given schema. Creates the `parser` for every call.
When performance matters, (re-)use `parser` instead.
sourceraw docstring

parserclj/s

(parser ?schema)
(parser ?schema options)

Returns an pure parser function of type x -> either parsed-x ::invalid for a given Schema. Caches the result for Cached Schemas with key :parser.

Returns an pure parser function of type `x -> either parsed-x ::invalid` for a given Schema.
Caches the result for [[Cached]] Schemas with key `:parser`.
sourceraw docstring

predicate-schemasclj/s

(predicate-schemas)
source

propertiesclj/s

(properties ?schema)
(properties ?schema options)

Returns the Schema properties

Returns the Schema properties
sourceraw docstring

properties-schemaclj/s

(properties-schema ?schema)
(properties-schema ?schema options)

Returns properties schema for Schema or IntoSchema.

Returns properties schema for Schema or IntoSchema.
sourceraw docstring

RefSchemaclj/sprotocol

-derefclj/s

(-deref this)

returns the referenced schema

returns the referenced schema

-refclj/s

(-ref this)

returns the reference name

returns the reference name
source

RegexSchemaclj/sprotocol

-regex-explainerclj/s

(-regex-explainer this path)

returns the raw internal regex explainer implementation

returns the raw internal regex explainer implementation

-regex-min-maxclj/s

(-regex-min-max this)

returns size of the sequence as [min max] vector. nil max means unbuond.

returns size of the sequence as [min max] vector. nil max means unbuond.

-regex-op?clj/s

(-regex-op? this)

is this a regex operator (e.g. :cat, :*...)

is this a regex operator (e.g. :cat, :*...)

-regex-parserclj/s

(-regex-parser this)

returns the raw internal regex parser implementation

returns the raw internal regex parser implementation

-regex-transformerclj/s

(-regex-transformer this transformer method options)

returns the raw internal regex transformer implementation

returns the raw internal regex transformer implementation

-regex-unparserclj/s

(-regex-unparser this)

returns the raw internal regex unparser implementation

returns the raw internal regex unparser implementation

-regex-validatorclj/s

(-regex-validator this)

returns the raw internal regex validator implementation

returns the raw internal regex validator implementation
source

Schemaclj/sprotocol

-validatorclj/s

(-validator this)

returns a predicate function that checks if the schema is valid

returns a predicate function that checks if the schema is valid

-optionsclj/s

(-options this)

returns original options

returns original options

-transformerclj/s

(-transformer this transformer method options)

returns a function to transform the value for the given schema and method. Can also return nil instead of identity so that more no-op transforms can be elided.

returns a function to transform the value for the given schema and method.
Can also return nil instead of `identity` so that more no-op transforms can be elided.

-walkclj/s

(-walk this walker path options)

walks the schema and it's children, ::m/walk-entry-vals, ::m/walk-refs, ::m/walk-schema-refs options effect how walking is done.

walks the schema and it's children, ::m/walk-entry-vals, ::m/walk-refs, ::m/walk-schema-refs options effect how walking is done.

-parserclj/s

(-parser this)

return a function of x -> parsed-x | ::m/invalid to explain how schema is valid.

return a function of `x -> parsed-x | ::m/invalid` to explain how schema is valid.

-propertiesclj/s

(-properties this)

returns original schema properties

returns original schema properties

-childrenclj/s

(-children this)

returns schema children

returns schema children

-formclj/s

(-form this)

returns original form of the schema

returns original form of the schema

-explainerclj/s

(-explainer this path)

returns a function of x in acc -> maybe errors to explain the errors for invalid values

returns a function of `x in acc -> maybe errors` to explain the errors for invalid values

-unparserclj/s

(-unparser this)

return the inverse (partial) function wrt. -parser; parsed-x -> x | ::m/invalid

return the inverse (partial) function wrt. `-parser`; `parsed-x -> x | ::m/invalid`

-parentclj/s

(-parent this)

returns the IntoSchema instance

returns the IntoSchema instance
source

schemaclj/s

(schema ?schema)
(schema ?schema options)

Creates a Schema object from any of the following:

  • Schema instance (just returns it)
  • IntoSchema instance
  • Schema vector syntax, e.g. [:string {:min 1}]
  • Qualified Keyword or String, using a registry lookup
Creates a Schema object from any of the following:

- Schema instance (just returns it)
- IntoSchema instance
- Schema vector syntax, e.g. [:string {:min 1}]
- Qualified Keyword or String, using a registry lookup
sourceraw docstring

schema-walkerclj/s

(schema-walker f)
source

schema?clj/s

(schema? x)

Checks if x is a Schema instance

Checks if x is a Schema instance
sourceraw docstring

sequence-schemasclj/s

(sequence-schemas)
source

Transformerclj/sprotocol

-transformer-chainclj/s

(-transformer-chain this)

returns transformer chain as a vector of maps with :name, :encoders, :decoders and :options

returns transformer chain as a vector of maps with :name, :encoders, :decoders and :options

-value-transformerclj/s

(-value-transformer this schema method options)

returns an value transforming interceptor for the given schema and method

returns an value transforming interceptor for the given schema and method
source

typeclj/s

(type ?schema)
(type ?schema options)

Returns the Schema type.

Returns the Schema type.
sourceraw docstring

type-propertiesclj/s

(type-properties ?schema)
(type-properties ?schema options)

Returns the Schema type properties

Returns the Schema type properties
sourceraw docstring

type-schemasclj/s

(type-schemas)
source

unparseclj/s

(unparse ?schema value)
(unparse ?schema value options)

Unparses a value against a given schema. Creates the unparser for every call. When performance matters, (re-)use unparser instead.

Unparses a value against a given schema. Creates the `unparser` for every call.
When performance matters, (re-)use `unparser` instead.
sourceraw docstring

unparserclj/s

(unparser ?schema)
(unparser ?schema options)

Returns an pure unparser function of type parsed-x -> either x ::invalid for a given Schema. Caches the result for Cached Schemas with key :unparser.

Returns an pure unparser function of type `parsed-x -> either x ::invalid` for a given Schema.
Caches the result for [[Cached]] Schemas with key `:unparser`.
sourceraw docstring

validateclj/s

(validate ?schema value)
(validate ?schema value options)

Returns true if value is valid according to given schema. Creates the validator for every call. When performance matters, (re-)use validator instead.

Returns true if value is valid according to given schema. Creates the `validator`
for every call. When performance matters, (re-)use `validator` instead.
sourceraw docstring

validatorclj/s

(validator ?schema)
(validator ?schema options)

Returns an pure validation function of type x -> boolean for a given Schema. Caches the result for Cached Schemas with key :validator.

Returns an pure validation function of type `x -> boolean` for a given Schema.
Caches the result for [[Cached]] Schemas with key `:validator`.
sourceraw docstring

walkclj/s

(walk ?schema f)
(walk ?schema f options)

Postwalks recursively over the Schema and it's children. The walker callback is a arity4 function with the following arguments: schema, path, (walked) children and options.

Postwalks recursively over the Schema and it's children.
The walker callback is a arity4 function with the following
arguments: schema, path, (walked) children and options.
sourceraw docstring

Walkerclj/sprotocol

-acceptclj/s

(-accept this schema path options)

-innerclj/s

(-inner this schema path options)

-outerclj/s

(-outer this schema path children options)
source

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

× close