I have a viewset with a method with this swagger_auto_schema decorator:
@swagger_auto_schema(
responses={200: MyResponseSerializer(many=True)},
query_serializer=MyQuerySerializer
)
When I define serializers.ChoiceField(choices=...)
in MyResponseSerializer, the enum for the choices are outputted to Swagger schema. When I use ChoiceField
in MyQuerySerializer, this is not outputted.
Is this by design? Is there a straightforward way of exporting choices enums for query_serializers, too?