All errors returned by REST API should be wrapped to JSON

Registered by Nikolay Markov

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:
milestone icon 6.1
Started by
Nikolay Markov
Completed by
Nikolay Markov

Related branches

Sprints

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.