i have a 2 serializers
when i get the list of ItemCategory i want have all fields so ItemCategorySerializer is enough but when i call ItemCategorySerializer from ItemSerializer i want print only id and name but when i generate the swagger schema inside my schema list i find ItemCategory with only ‘id’, ‘name’
class ItemCategorySerializer(coreSerializers.DynamicModelSerializer):
class Meta:
model = ItemCategory
fields = "__all__"
class ItemSerializer(coreSerializers.DynamicModelSerializer,):
class Meta:
model = Item
fields = "__all__"
category_obj = ItemCategorySerializer(source='category', many=False, read_only=True, required=False, allow_null=True, partial=True, fields=['id', 'name', ])
so, i have this inside swagger this schema
but i want that
i think that happen because before it generate ItemCategory full
then ItemSerializer call ItemCategorySerializer and replace ItemCategory full with minimized:
how i can force to use in schema model ItemCategory full ?