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 use SerializerMethodResourceRelatedField and the resource name is then calculated by the returning instance. Does this help? Or have I misunderstood your question? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
OneOfSerializeris my custom serializer accepting values either forAorB. The main problem is that it doesn't containJSONAPIMetaand DRF-jsonapi raises an exception. Would it be possible to somehow return theresource_namedynamically based on the data, so that the relation is correctly set?Beta Was this translation helpful? Give feedback.
All reactions