Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export enums with drf-yasg to Swagger: Works in responses serializers but not in query_serializer #876

Open
Schwankenson opened this issue Dec 1, 2023 · 0 comments

Comments

@Schwankenson
Copy link

Schwankenson commented Dec 1, 2023

Bug Report

Description

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.

Detailed description:
https://stackoverflow.com/questions/77584761/export-enums-with-drf-yasg-to-swagger-works-in-responses-serializers-but-not-in

Minimal Reproduction

@swagger_auto_schema(
    responses={200: MyResponseSerializer(many=True)}, 
    query_serializer=MyQuerySerializer
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant