All errors returned by REST API should be wrapped to JSON
Currently we're returning all errors as a plain text string, which is bad. Let's implement a wrapper on the highest level to wrap all possible errors to proper JSON.
Proposed JSON format for error looks like this:
HTTP/1.1 422 Unprocessable Entity
Content-Length: 149
{
"message": "Validation Failed",
"errors": [
{
"resource": "Issue",
"field": "title",
"code": "missing_field"
}
]
}
Link to doc with discussion on other possible formats is provided as specification.
Blueprint information
- Status:
- Complete
- Approver:
- Nikolay Markov
- Priority:
- Medium
- Drafter:
- Nikolay Markov
- Direction:
- Approved
- Assignee:
- Nikolay Markov
- Definition:
- Approved
- Series goal:
- Accepted for 6.1.x
- Implementation:
- Implemented
- Milestone target:
- 6.1
- Started by
- Nikolay Markov
- Completed by
- Nikolay Markov
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
Wrap errors to JSON in Nailgun API
Gerrit topic: https:/
Gerrit topic: https:/
Gerrit topic: https:/
Addressed by: https:/
Frontend for json wrapper for errors