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
I have noticed a behavior that is against the JSON:API spec.
The top level document could contain a data or errors attribute, but both MUST NOT coexist in the same document. See https://jsonapi.org/format/1.0/#document-top-level
While this is never the case in the response, it can also occur in the request.
What I do:
As an example let one send the following request:
POST https://api.example.com/posts
{
"data": {
"type": "posts",
"attributes": {
"content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu."
}
},
"errors": [
{
"detail": "The members data and errors MUST NOT coexist in the same document."
"links": {
"about": "https://jsonapi.org/format/1.0/#document-top-level"
}
}
]
}
What happend:
The server accepted the request.
What I expect:
The Server refuses the request because the body does not contain valid JSON:API.
The text was updated successfully, but these errors were encountered:
@Art4 Thank you very much for reporting the issue! I can confirm, this validation is currently missing from the library. I'll implement it in the following week(s), but you can also do so if you are up to prepare a PR. :)
Hello and thank you for this great library.
I have noticed a behavior that is against the JSON:API spec.
The top level document could contain a
data
orerrors
attribute, but both MUST NOT coexist in the same document. See https://jsonapi.org/format/1.0/#document-top-levelWhile this is never the case in the response, it can also occur in the request.
What I do:
As an example let one send the following request:
What happend:
The server accepted the request.
What I expect:
The Server refuses the request because the body does not contain valid JSON:API.
The text was updated successfully, but these errors were encountered: