Agent Wranglers

Errors Required

Name every field that failed

When input fails validation, return every failing field at once, with where it is and why it failed.

How to do it

Add an errors array to the problem details. Give each entry a JSON Pointer to the field and a plain reason. RFC 9457 shows this pattern.

Example

{
  "type": "https://api.example.com/problems/invalid-input",
  "title": "The request has invalid fields",
  "status": 422,
  "detail": "2 fields are invalid.",
  "errors": [
    { "pointer": "#/items/0/quantity", "detail": "Must be 1 or more." },
    { "pointer": "#/email", "detail": "Must be an email address." }
  ]
}

How to check

Send a body with two invalid fields. The answer lists both, with pointers such as #/items/0/quantity.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers api design playbook: https://agentwranglers.se/playbook/api-design/errors/validation-errors.