Open
Description
I'm curious if this was discussed before and done intentionally.
For some reason, the status
value is not passed into the format_message
method here in error!
:
grape/lib/grape/middleware/error.rb
Lines 132 to 137 in 5ce44de
Passing it would make including it in the response body JSON easier. This is the way it's included in the JSON API error response bodies:
# HTTP/1.1 422 Unprocessable Entity
# Content-Type: application/vnd.api+json
{
"errors": [
{
"status": "422",
"source": { "pointer": "/data/attributes/firstName" },
"title": "Invalid Attribute",
"detail": "First name must contain at least two characters."
}
]
}