django-rest-framework-json-api icon indicating copy to clipboard operation
django-rest-framework-json-api copied to clipboard

JSON API 1.1: return included array even if nothing is included

Open sliverc opened this issue 2 years ago • 2 comments

Description of feature request

Currently, when there are no included resources, there is no included key. However, as of JSON API 1.1 this is required and in older versions it is certainly allowed. So whenever a user has requested includes with the query parameter include an included key needs to be part of the result. But only then. If there is no include query parameter, no include should be added.

Checklist

  • [x] Raised initially as discussion #1092
  • [x] This cannot be dealt with as a third party library. (We prefer new functionality to be in the form of third party libraries where feasible.)
  • [x] I have reduced the issue to the simplest possible case.

sliverc avatar Nov 29 '22 11:11 sliverc

#1153 has the enhancement

Anirudh3167 avatar Jun 04 '23 02:06 Anirudh3167

Hey @sliverc I have issued the PR #1153 Kindly review and merge it. Thanks

Anirudh3167 avatar Jun 06 '23 11:06 Anirudh3167