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-entity-level-specclj/s

(-process-entity-level-spec process key spec entity)

-process-errorclj/s

(-process-error process options)

-process-field-specclj/s

(-process-field-spec process spec value)

-process-spec-on-valueclj/s

(-process-spec-on-value process spec value)

-spec-schemaclj/s


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)

DEPRECATED

DEPRECATED
raw docstring

coerce-message-mapclj/s

(coerce-message-map 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

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

DEPRECATED

DEPRECATED
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)

DEPRECATED

DEPRECATED
raw docstring

conform-message-mapclj/s

(conform-message-map 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-schema!clj/s

(conform-schema! schema)

Normalizes, coerces, and validates all the specs in the schema. Any problems in the schema will throw an exception. Any extra fields in the spec (:value, :db, ...) will be preserved.

Normalizes, coerces, and validates all the specs in the schema.  Any problems in the schema will throw an exception.
Any extra fields in the spec (:value, :db, ...) will be preserved.
raw docstring

conform-valueclj/s

(conform-value spec value)
(conform-value schema key value)

DEPRECATED

DEPRECATED
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)

entity-spec-schemaclj/s


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

(error-message-map result)

DEPRECATED

DEPRECATED
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

(messages result)

DEPRECATED

DEPRECATED
raw docstring

nil-orclj/s

(nil-or f)

nil?-orclj/s

(nil?-or f)

normalize-schemaclj/s

(normalize-schema schema)

Returns the schema with all shorthand specs expanded.

Returns the schema with all shorthand specs expanded.
raw docstring

normalize-specclj/s

(normalize-spec spec)

If the spec is using a shorthand, it will be expanded.

If the spec is using a shorthand, it will be expanded.
raw docstring

normalized?clj/s

(normalized? schema-or-spec)

Returns true if the schema-or-spec has been normalized, false otherwise.

Returns true if the schema-or-spec has been normalized, false otherwise.
raw docstring

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

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

DEPRECATED

DEPRECATED
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)

process-map-spec-on-valueclj/s

(process-map-spec-on-value process spec value)

process-one-of-on-valueclj/s

(process-one-of-on-value process spec value)

process-spec-schemaclj/s


requiredclj/s


spec-schemaclj/s


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-typesclj/s


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)

DEPRECATED

DEPRECATED
raw docstring

validate-message-mapclj/s

(validate-message-map 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

(validation-errors schema entity)

DEPRECATED

DEPRECATED
raw docstring

validation-schemaclj/s

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

× close