Defines data structure, coerces, validates.
Defines data structure, coerces, validates.
(->bigdec v)
(->boolean value)
(->date v)
(->float v)
(->int v)
(->keyword value)
(->seq v)
(->sql-date v)
(->string value)
(->timestamp v)
(->uri v)
(->uuid v)
(-coerce-value! coerce-fn value ?seq)
(bigdec? v)
(coerce schema entity)
Returns coerced entity or SchemaError if any coercion failed. Use error? to check result. Use Case: 'I want to change my data into the types specified by the schema.'
Returns coerced entity or SchemaError if any coercion failed. Use error? to check result. Use Case: 'I want to change my data into the types specified by the schema.'
(coerce! schema entity)
(coerce-ex v type)
(coerce-ex? e)
(coerce-value spec value)
(coerce-value schema key value)
returns coerced value or throws an exception
returns coerced value or throws an exception
(conform schema entity)
Returns coerced entity or SchemaError upon any coercion or validation failure. Use error? to check result. Use Case: 'I want to coerce my data then validate the coerced data, all according to the schema.' Use Case: Data comes in from a web-form so strings have to be coerced into numbers, etc., then we need to validate that the data is good.
Returns coerced entity or SchemaError upon any coercion or validation failure. Use error? to check result. Use Case: 'I want to coerce my data then validate the coerced data, all according to the schema.' Use Case: Data comes in from a web-form so strings have to be coerced into numbers, etc., then we need to validate that the data is good.
(conform! schema entity)
(conform-all! schema entities)
(conform-errors schema entity)
(conform-value spec value)
(conform-value schema key value)
coerce and validate, returns coerced value or throws
coerce and validate, returns coerced value or throws
(email? value)
(error-message-map result)
Nil when there are no errors, otherwise a map {<field> <message>} .
Nil when there are no errors, otherwise a map {<field> <message>} .
(error? result)
(exmessage e)
(is-enum? enum)
(kind key)
(make-error errors schema before after)
(merge-schemas & schemas)
(merge-specs a b)
(messages result)
Sequence of error messages in a validate/coerce/conform result; nil if none.
Sequence of error messages in a validate/coerce/conform result; nil if none.
(nil-or f)
Used as a :present value to remove the entry from presentation
Used as a :present value to remove the entry from presentation
(parse! f v)
(present schema entity)
Returns presentable entity or SchemaError upon any presentation failure. Use error? to check result.
Returns presentable entity or SchemaError upon any presentation failure. Use error? to check result.
(present! schema entity)
(present-value {:keys [type] :as spec} value)
(present-value schema key value)
returns a presentable representation of the value
returns a presentable representation of the value
(present? v)
(result-or-ex f spec value)
(str-or-nil v)
(type-coercer! type)
(type-validator! type)
(uri? value)
(valid-value? spec value)
(valid-value? schema key value)
return true or false
return true or false
(validate schema entity)
Returns entity with all values true, or SchemaError when one or more invalid fields. Use error? to check result. Use Case: 'I want to make sure all the data is valid according to the schema.'
Returns entity with all values true, or SchemaError when one or more invalid fields. Use error? to check result. Use Case: 'I want to make sure all the data is valid according to the schema.'
(validate! schema entity)
(validate-coerced-value! spec value coerced)
throws an exception when validation fails, value otherwise.
throws an exception when validation fails, value otherwise.
(validate-value! spec value)
(validate-value! schema key value)
throws an exception when validation fails, value otherwise
throws an exception when validation fails, value otherwise
(validation-errors schema entity)
(without-ex result)
replace exceptions with ex-data
replace exceptions with ex-data
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close