Django Rest Swagger无法将Inner Serializer解析为对象数组,而只显示字符串列表
我的序列化器:
class InfluencerSerializer(serializers.Serializer):
prices = PriceSerializer(many=True)
first_name = serializer.CharField(max_length=100)
class PriceSerializer(serializers.Serializer):
cost = serializers.IntegerField(default=0)
在Swagger UI上,它显示在Example
中的json下面{
"first_name": "string",
"prices": ["string"],
}
虽然我期待Swagger UI显示 { " first_name":" string", "价格":[ {"成本":0} ] }
我正在使用
Django==1.10.6
djangorestframework==3.6.1
django-rest-swagger==2.1.2