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.
(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.(validate-contract payload)The contract errors in an accepted payload, as a vector.
The contract errors in an accepted `payload`, as a vector.
(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.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |