I need my API to serve explicit error codes for UI applications, that will look similar to i.e. GitHub API:
HTTP/1.1 422 Unprocessable Entity
Content-Length: 149
{
"message": "Validation Failed",
"errors": [
{
"resource": "Issue",
"field": "title",
"code": "missing_field"
}
]
}
What is the best way to implement it in DRF? Is there any package to handle this?