You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably a duplicate of #15 (or at least closely related). Possibly drf-flex-fields solves your use case?
It's nontrivial to solve this for the general case and since I don't have much time to maintain this library I want to intentionally keep it simple (unless @jtrain thinks this is worth pursueing or unless a PR is submitted with a very simple implementation and tests). So currently recursive filtering is out of scope.
I agree with @dbrgn here. Applying the filtering to child serializers could spiral our complexity.
One way I'd solve this is to use a separate serializer for the children that doesn't have the fields you don't want. You needn't even use a ModelSerializer base, just a plain serializer.Serializer for a nice performance boost too.
This is my serializer:
This is my request:
This is my response:
The
parent
field comes in nested children, except for the root objects in which only the fields that I mentioned come.The text was updated successfully, but these errors were encountered: