Liking cljdoc? Tell your friends :D

c3kit.apron.schema

Defines data structure, coerces, validates.

Defines data structure, coerces, validates.
raw docstring

->bigdecclj/s

(->bigdec v)

->booleanclj/s

(->boolean value)

->dateclj/s

(->date v)

->floatclj/s

(->float v)

->intclj/s

(->int v)

->keywordclj/s

(->keyword value)

->seqclj/s

(->seq v)

->sql-dateclj/s

(->sql-date v)

->stringclj/s

(->string value)

->timestampclj/s

(->timestamp v)

->uriclj/s

(->uri v)

->uuidclj/s

(->uuid v)

-process-entityclj/smultimethod


-process-errorclj/smultimethod


-process-fieldclj/smultimethod


bigdec?clj/s

(bigdec? v)

coerceclj/s

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

coerce!clj/s

(coerce! schema entity)

Returns a coerced entity or throws an exception if there are errors.

Returns a coerced entity or throws an exception if there are errors.
raw docstring

coerce-errorsclj/s

(coerce-errors schema entity)

Runs coerce on the entity and returns a map of error message, or nil if none.

Runs coerce on the entity and returns a map of error message, or nil if none.
raw docstring

coerce-valueclj/s

Same as coerce-value!. Exists for backwards compatibility.

Same as coerce-value!.  Exists for backwards compatibility.
raw docstring

coerce-value!clj/s

(coerce-value! spec value)
(coerce-value! schema key value)

returns coerced value or throws an exception

returns coerced value or throws an exception
raw docstring

conformclj/s

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

conform!clj/s

(conform! schema entity)

Returns a conformed entity or throws an exception if there are errors.

Returns a conformed entity or throws an exception if there are errors.
raw docstring

conform-errorsclj/s

(conform-errors schema entity)

Runs conform on the entity and returns a map of error message, or nil if none.

Runs conform on the entity and returns a map of error message, or nil if none.
raw docstring

conform-valueclj/s

Same as conform-value!. Exists for backwards compatibility.

Same as conform-value!.  Exists for backwards compatibility.
raw docstring

conform-value!clj/s

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

dateclj/s


email-patternclj/s


email?clj/s

(email? value)

error-dataclj/s

(error-data field-error)

Return the data map associated with the FieldError.

Return the data map associated with the FieldError.
raw docstring

error-exceptionclj/s

(error-exception field-error)

Return the exception attached to a FieldError if any, otherwise nil.

Return the exception attached to a FieldError if any, otherwise nil.
raw docstring

error-mapclj/s

(error-map result)

error-messageclj/s

(error-message error)

Return the message of an error.

Return the message of an error.
raw docstring

error-message-mapclj/s

Same as message-map. Exists for backwards compatibility.

Same as message-map.  Exists for backwards compatibility.
raw docstring

error-seqclj/s

(error-seq entity)

Returns a sequence of all the FieldErrors in a processed entity.

Returns a sequence of all the FieldErrors in a processed entity.
raw docstring

error-typeclj/s

(error-type field-error)

Return the target type of a CoerceError, if any, otherwise nil.

Return the target type of a CoerceError, if any, otherwise nil.
raw docstring

error-valueclj/s

(error-value field-error)

Return the value that caused the FieldError, if any, otherwise nil.

Return the value that caused the FieldError, if any, otherwise nil.
raw docstring

error?clj/s

(error? entity)

Return true if the processed entity has errors, false otherwise.

Return true if the processed entity has errors, false otherwise.
raw docstring

field-error?clj/s

(field-error? value)

Returns true if the value is a FieldError, false otherwise.

Returns true if the value is a FieldError, false otherwise.
raw docstring

FieldErrorclj/sprotocol


idclj/s


is-enum?clj/s

(is-enum? enum)

kindclj/s

(kind key)

merge-schemasclj/s

(merge-schemas & schemas)

merge-specsclj/s

(merge-specs a b)

message-mapclj/s

(message-map result)

nil when there are no errors, otherwise a map {<field> <error message>}.

nil when there are no errors, otherwise a map {<field> <error message>}.
raw docstring

message-seqclj/s

(message-seq result)

seq of 'friendly' error messages; nil if none.

seq of 'friendly' error messages; nil if none.
raw docstring

messagesclj/s

Same as message-seq. Exists for backwards compatibility.

Same as message-seq.  Exists for backwards compatibility.
raw docstring

nil-orclj/s

(nil-or f)

omitclj/s

Used as a :present value to remove the entry from presentation

Used as a :present value to remove the entry from presentation
raw docstring

parse!cljs

(parse! f v)

presentclj/s

(present schema entity)

Returns presented entity with FieldErrors where the process failed. Use error? to check result.

Returns presented entity with FieldErrors where the process failed. Use error? to check result.
raw docstring

present!clj/s

(present! schema entity)

Returns a presented entity or throws an exception if there are errors.

Returns a presented entity or throws an exception if there are errors.
raw docstring

present-valueclj/s

Same as present-value!. Exists for backwards compatibility.

Same as present-value!.  Exists for backwards compatibility.
raw docstring

present-value!clj/s

(present-value! spec value)
(present-value! schema key value)

returns a presentable representation of the value, or throws

returns a presentable representation of the value, or throws
raw docstring

present?clj/s

(present? v)

str-or-nilclj/s

(str-or-nil v)

type-coercer!clj/s

(type-coercer! type)

type-coercersclj/s


type-validator!clj/s

(type-validator! type)

type-validatorsclj/s


uri?clj/s

(uri? value)

valid-value?clj/s

(valid-value? spec value)
(valid-value? schema key value)

return true or false

return true or false
raw docstring

validateclj/s

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

validate!clj/s

(validate! schema entity)

Returns a validated entity or throws an exception if there are errors.

Returns a validated entity or throws an exception if there are errors.
raw docstring

validate-errorsclj/s

(validate-errors schema entity)

Runs validate on the entity and returns a map of error message, or nil if none.

Runs validate on the entity and returns a map of error message, or nil if none.
raw docstring

validate-value!clj/s

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

validation-errorsclj/s

Same as validate-errors. Exists for backwards compatibility.

Same as validate-errors.  Exists for backwards compatibility.
raw docstring

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

× close