Meta fields are not filtered out dynamically
SafaAlfulaij opened this issue · 2 comments
Description of the Bug Report
DRF supports dynamically changing the fields returned per request. This works well (despite the performance issues, etc)
Meta fields though does not get filtered based on this properly. If the field is excluded, it will be rendered with a null value (since the actual value is not provided by DRF).
My expectation is that it does not render at all.
Culprits:
django-rest-framework-json-api/rest_framework_json_api/serializers.py
Lines 305 to 318 in e9ca8d9
django-rest-framework-json-api/rest_framework_json_api/renderers.py
Lines 411 to 425 in e9ca8d9
Checklist
- Certain that this is a bug (if unsure or you have a question use discussions instead)
- Code snippet or unit test added to reproduce bug
As I see it is this basically the same bug as described in #332 as the sparse fields mixin uses this feature to dynamically change the fields.
Indeed. Closing this then.