validation_failed
- Returned as
- The problem's code
- HTTP status
- 400 Bad Request
- type
https://zautha.com/docs/errors/validation_failed
When it happens
Section titled “When it happens”The request was read, but one or more of its fields break a rule. The problem’s errors array has one entry per field:
its field (the request’s field name, such as email_address or limit), a code from the
field errors and a message.
{ "type": "https://zautha.com/docs/errors/validation_failed", "title": "Bad Request", "status": 400, "detail": "One or more fields are invalid.", "code": "validation_failed", "errors": [{ "field": "limit", "code": "invalid_range", "message": "limit must be between 1 and 100." }], "trace_id": "…"}What to do
Section titled “What to do”Fix each field the errors array names; branch on its code, not on the message. @zautha/js gives the same list as
fieldErrors, with the field names in camelCase.