- 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.
-
I have the following structure of serializers classA(Serializer)classJSONAPIMeta:resource_name="A"classB(Serializer)classJSONAPIMeta:resource_name="B"classMySerializer(Serializer)my_field=OneOfSerializer(A(),B())
|
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 1 comment 2 replies
-
What version of DJA are you using? Since DJA version 4.0.0 nested serializers are not rendered as relationships anymore but as attribute value. So when I look at your example this would actually be rendered as attribute value instead and resource name is not needed in this case. But if you wanna have dynamic relationships you can useSerializerMethodResourceRelatedField and the resource name is then calculated by the returning instance. Does this help? Or have I misunderstood your question? |
BetaWas this translation helpful?Give feedback.
All reactions
-
I'm using version 3.1.0. |
BetaWas this translation helpful?Give feedback.
All reactions
-
Yes it should work but give it a try. |
BetaWas this translation helpful?Give feedback.
All reactions
This discussion was converted from issue #931 on April 29, 2021 19:20.