What is the recommended REST API response structure when validation fails for multiple fields in a POST request body?
- A.Return 207 Multi-Status (or 200 OK) with a plain text body joining all violations in one string: 'email invalid; age out of range; name too short', with the HTTP status line summarizing the first failure only, and the Content-Type set to text/plain for old clients that cannot parse JSON in their mobile build
- B.Return 400 Bad Request (or 404 Not Found for the whole call) with a header X-Error-Fields: email,age listing all fields that failed validation in the request body, and an empty response body of zero bytes; the client reads the header and fetches /errors/{id} for each message separately, with one extra request per failing field
- C.Return 400 Bad Request (or 422 Unprocessable Content) with a structured error body listing all field-level violations: { 'errors': [{ 'field': 'email', 'code': 'INVALID_FORMAT', 'message': 'Invalid email format' }, { 'field': 'age', 'code': 'OUT_OF_RANGE', 'message': 'Age must be between 0 and 150' }] }