- Notifications
You must be signed in to change notification settings - Fork302
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Taking the familiar example of a blog post/article, would it be possible to return both the comments on the articleand the authors of those comments? The following quote (emphasis mine) leads me to believe this use case to be in-spec., but I'm not sure how to do so with DJA:
|
BetaWas this translation helpful?Give feedback.
All reactions
Yes this is possible as perspecification include needs to be defined dotted.
So for your example the include query parameter should look like this:
GET /articles/1?include=comments.author HTTP/1.1
For this to work you defineincluded_serializers
in your serializers as perdocumentation.
Replies: 1 comment 1 reply
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Yes this is possible as perspecification include needs to be defined dotted. So for your example the include query parameter should look like this:
For this to work you define |
BetaWas this translation helpful?Give feedback.
All reactions
-
Forgot to say thanks for this. I was mistakenly thinking I needed to somehow reference |
BetaWas this translation helpful?Give feedback.
All reactions
This discussion was converted from issue #952 on July 06, 2021 18:46.