JSON API Errors¶
See the JSON API error spec and examples.
Deviations¶
LeafLink API errors deviate from JSON API errors in two ways:
- LeafLink APIs do not wrap request bodies in the
data
top level key. Thus, errorsource.pointer
properties will never begin with/data/
, they will begin with/
. - Error responses will return a
Content-Type
ofapplication/json
, notapplication/vnd.api+json
. This is because we do not strictly meet the JSON API error spec.
Remarks¶
Error title properties should always be the same for the same error type. Example:
// No
{
"errors": [
{
...,
"title": "Product #123 not found."
},
{
...,
"title": "Order #456 not found."
}
]
}
// Yes
{
"errors": [
{
...,
"title": "Not found.",
"detail": "Product #123 could not be found."
},
{
...,
"title": "Not found.",
"detail": "Order #456 could not be found."
}
]
}