You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great gem, but the error message "Key is not included in URL" seems misleading to me for some reasons.
I) It is not clear whar is meant by "key" (I would suggest "id").
II) The message references a concrete problem in the URL, a missing key, which might not be true (e.g. a wrong key might be the problem as well).
III) The error could have happened in the data section as well.
IV) This message is returned whenever something goes wrong with the id (e.g. wrong type of id field in the data section), see example
Example: The following patch request to the correct url (and id) might cause this error message due to an invalid data type (int) for id. It has nothing to do with a "not included" key in the url.
The request is invalid because of the wrong type (int) for "id". It MUST be string (conforming to json api), and jsonapi-resources correctly refuses to process this request, but with this misleading error message.
Suggestion for this Message: "id field is invalid or does not match the id given in the URL."
The text was updated successfully, but these errors were encountered:
Good catch. That error message is a remnant of an early draft of JSON API when a replace operation could target multiple resources. I think it would be most accurate to declare that the resource object does not match the request URL.
Looking at the code in parse_single_replace_operation it could also use some cleanup to reflect the more restrictive nature of the final spec.
Great gem, but the error message "Key is not included in URL" seems misleading to me for some reasons.
I) It is not clear whar is meant by "key" (I would suggest "id").
II) The message references a concrete problem in the URL, a missing key, which might not be true (e.g. a wrong key might be the problem as well).
III) The error could have happened in the data section as well.
IV) This message is returned whenever something goes wrong with the id (e.g. wrong type of id field in the data section), see example
Example: The following patch request to the correct url (and id) might cause this error message due to an invalid data type (int) for id. It has nothing to do with a "not included" key in the url.
{
data: {
"type": "articles",
"id": 1,
"attributes": {
"title": "updated title"
}
}
}
The request is invalid because of the wrong type (int) for "id". It MUST be string (conforming to json api), and jsonapi-resources correctly refuses to process this request, but with this misleading error message.
Suggestion for this Message: "id field is invalid or does not match the id given in the URL."
The text was updated successfully, but these errors were encountered: