Expand description
A typed, validated JSON body extractor.
Valid<T> is the Valid<Json<T>>-style extractor: it reads the request
body as JSON into T, then runs T’s Validate check. A parse failure or
a validation failure both become a 422
Problem; otherwise the handler receives a value
already known to be well-formed and valid.
Structs§
- Valid
- A request body that deserialized into
Tand passedT’sValidatecheck. Destructure it asValid(value)in a handler. - Validation
Error - Why a body was rejected as invalid. A single message in this first cut; a later phase can carry a per-field map.
Traits§
- Validate
- A domain-shaped validation check on a deserialized body. Keep it cheap and synchronous: structural and range checks, not I/O. Business rules that need ports belong in the application layer, not here.