(-collection-schema {type :type
fpred :pred
fempty :empty
fin :in
:or {fin (fn [i _] i)}
:as opts})
(-intercepting {:keys [enter leave]})
(-intercepting {:keys [enter leave] :as interceptor} f)
(-parent-children-transformer parent children transformer method options)
(-sequence-entry-schema {:keys [type child-bounds re-validator re-explainer
re-parser re-transformer]
:as opts})
(-sequence-schema {:keys [type child-bounds re-validator re-explainer re-parser
re-transformer]
:as opts})
(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`
(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.
(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.
(deref ?schema)
(deref ?schema options)
Derefs top-level RefSchema
s or returns original Schema.
Derefs top-level `RefSchema`s or returns original Schema.
(deref-all ?schema)
(deref-all ?schema options)
Derefs top-level RefSchema
s recursively or returns original Schema.
Derefs top-level `RefSchema`s recursively or returns original Schema.
(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.
(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.
(entries ?schema)
(entries ?schema options)
Returns MapSchema
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)
Returns `MapSchema` 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)
(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.
(explainer ?schema)
(explainer ?schema options)
Returns an pure explainer function of type x -> explanation
for a given Schema
Returns an pure explainer function of type `x -> explanation` for a given Schema
(form ?schema)
(form ?schema options)
Returns the Schema form
Returns the Schema form
(-arity this)
(-input-schema this)
(-output-schema this)
(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
(into-schema? x)
Checks if x is a IntoSchema instance
Checks if x is a IntoSchema instance
(-into-schema this properties children options)
creates a new schema instance
creates a new schema instance
(-get this key default)
returns schema at key
returns schema at key
(-keep this)
returns truthy if schema contributes to value path
returns truthy if schema contributes to value path
(-set this key value)
returns a copy with key having new value
returns a copy with key having new value
(-entries this)
returns sequence of key -val-schema
MapEntries
returns sequence of `key -val-schema` MapEntries
(options ?schema)
(options ?schema options)
Returns options used in creating the Schema
Returns options used in creating the Schema
(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.
(parser ?schema)
(parser ?schema options)
Returns an pure parser function of type x -> either parsed-x ::invalid
for a given Schema
Returns an pure parser function of type `x -> either parsed-x ::invalid` for a given Schema
(properties ?schema)
(properties ?schema options)
Returns the Schema properties
Returns the Schema properties
(-deref this)
returns the referenced schema
returns the referenced schema
(-ref this)
returns the reference name
returns the reference name
(-regex-explainer this path)
returns the raw internal regex explainer implementation
returns the raw internal regex explainer implementation
(-regex-op? this)
is this a regex operator (e.g. :cat, :*...)
is this a regex operator (e.g. :cat, :*...)
(-regex-parser this)
returns the raw internal regex parser implementation
returns the raw internal regex parser implementation
(-regex-transformer this transformer method options)
returns the raw internal regex transformer implementation
returns the raw internal regex transformer implementation
(-regex-validator this)
returns the raw internal regex validator implementation
returns the raw internal regex validator implementation
(-validator this)
returns a predicate function that checks if the schema is valid
returns a predicate function that checks if the schema is valid
(-options this)
returns original options
returns original options
(-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.
(-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.
(-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.
(-properties this)
returns original schema properties
returns original schema properties
(-type this)
returns type of the schema
returns type of the schema
(-children this)
returns schema children
returns schema children
(-form this)
returns original form of the schema
returns original form of the schema
(-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
(-type-properties this)
returns schema type properties
returns schema type properties
(-parent this)
returns the IntoSchema instance
returns the IntoSchema instance
(schema ?schema)
(schema ?schema options)
Creates a Schema object from any of the following:
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
(schema? x)
Checks if x is a Schema instance
Checks if x is a Schema instance
(-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-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
(type ?schema)
(type ?schema options)
Returns the Schema type.
Returns the Schema type.
(type-properties ?schema)
(type-properties ?schema options)
Returns the Schema type properties
Returns the Schema type properties
(validate ?schema value)
(validate ?schema value options)
Validates a value againsta a given schema. Creates the validator
for every call.
When performance matters, (re-)use validator
instead.
Validates a value againsta a given schema. Creates the `validator` for every call. When performance matters, (re-)use `validator` instead.
(validator ?schema)
(validator ?schema options)
Returns an pure validation function of type x -> boolean
for a given Schema
Returns an pure validation function of type `x -> boolean` for a given Schema
(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.
(-accept this schema path options)
(-inner this schema path options)
(-outer this schema path children options)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close