From the Deleting resources of the JSON:api spec topic (emphasis mine):
200 OK
A server MUST return a200 OK
status code if a deletion request is successful and the server responds with only top-level meta data.
We are using a “soft delete” pattern, so this makes our DELETE
implementation feel more like a PATCH
, e.g., from the JSON:api PATCH
spec:
200 OK
If a server accepts an update but also changes the resource(s) in ways other than those specified by the request (for example, updating theupdated-at
attribute or a computedsha
), it MUST return a200 OK
response. The response document MUST include a representation of the updated resource(s) as if aGET
request was made to the request URL.
The DELETE
spec reads, without an example, that the representation of the updated resource would not be returned. However, I’m thinking it should be, versus a single top-level meta
object (as I read the spec, the only permitted response content is a top level meta
object).
Thoughts on including the updated resource in the 200 OK
for a DELETE
where a soft delete is the implementation?