In a test I sent a to-one relation with the type member set to dance-events, when the relationship expects a products resource. As the id sent with the incorrect type did not exist, I received this error message:
{
"errors": [
{
"detail": "The related resource does not exist.",
"source": {
"pointer": "/data/relationships/product"
},
"status": "404",
"title": "Not Found"
}
],
"jsonapi": {
"version": "1.0"
}
}
What I should have actually received was a message saying the the dance-events resource was an invalid resource type for the relationship. The above message implies that the related resource is being tested for existence before being checked for it being the expected type. It would make more sense to check the type first, then check for existence.