Django Rest Swagger is not able to parse the Inner Serializer as an array of objects instead it shows only list of string
My Serializers:
class InfluencerSerializer(serializers.Serializer):
prices = PriceSerializer(many=True)
first_name = serializer.CharField(max_length=100)
class PriceSerializer(serializers.Serializer):
cost = serializers.IntegerField(default=0)
On Swagger UI it appears as below json in Example
{
"first_name": "string",
"prices": ["string"],
}
While I am expected Swagger UI to show { "first_name": "string", "prices": [ {"cost":0} ], }
I am using
Django==1.10.6
djangorestframework==3.6.1
django-rest-swagger==2.1.2
django-rest-swagger does not support nested serializers and lists (ref), use drf-yasg instead
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With