Skip to content

Incorrect parsing of 204 response #110

@jely2002

Description

@jely2002

If a deletion request is successful, the server MUST return either a 200 OK status code and response document (as described above) or a 204 No Content status code with no response document.

https://jsonapi.org/format/#crud-deleting-responses

As can be seen in the JSON:API spec a server can also return a 204 with empty content. Right now this blows up, as the delete method on the document client will try to parse the response. Which will fail as we then try to json_decode an empty string, which is not valid JSON.

I propose to handle the 204 in the response parser and return an empty document to fix this problem.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions