marshmallow-jsonapi icon indicating copy to clipboard operation
marshmallow-jsonapi copied to clipboard

links are not included when data is None

Open RazerM opened this issue 4 years ago • 0 comments

wrap_response seems to think that a self link can't be provided when there isn't any data but I don't see this in the spec:

https://github.com/marshmallow-code/marshmallow-jsonapi/blob/22c0e38cc233ce3fa7fd25b32377c0b6d23eaa3c/marshmallow_jsonapi/schema.py#L418-L427

There is an example of such a response at https://jsonapi.org/format/#fetching-resources-responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "links": {
    "self": "http://example.com/articles/1/author"
  },
  "data": null
}

RazerM avatar Aug 07 '19 16:08 RazerM