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
datatop level key. Thus, errorsource.pointerproperties will never begin with/data/, they will begin with/. - Error responses will return a
Content-Typeofapplication/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."
}
]
}
