Liking cljdoc? Tell your friends :D

barebuild.validation

What a payload must satisfy, and how a record is read into its declared types. Two checkers over the same declared shape: validate-contract for an accepted envelope the server sent, validate-payload for a record the client is about to send.

What a payload must satisfy, and how a record is read into its declared types. Two checkers
over the same declared shape: `validate-contract` for an accepted envelope the server sent,
`validate-payload` for a record the client is about to send.
raw docstring

conform-payloadcljs

(conform-payload record shape)

The write-side entry point. Returns {:record <record read as shape declares it> :errors [...]}, the first being what to send and the second what to show. Coercing precedes validating, so a number field arriving from a form as a string is not reported as the wrong type.

The write-side entry point. Returns {:record <`record` read as `shape` declares it> :errors
[...]}, the first being what to send and the second what to show. Coercing precedes validating,
so a number field arriving from a form as a string is not reported as the wrong type.
sourceraw docstring

validate-contractcljs

(validate-contract payload)

The contract errors in an accepted payload, as a vector.

The contract errors in an accepted `payload`, as a vector.
sourceraw docstring

validate-payloadcljs

(validate-payload payload shape)

The write-side errors in payload against shape, as a vector, matching validate-contract. Runs after coerce-record, so a value here is already of its declared type.

The write-side errors in `payload` against `shape`, as a vector, matching `validate-contract`.
Runs after `coerce-record`, so a value here is already of its declared type.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close