-
Notifications
You must be signed in to change notification settings - Fork 270
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
wrong Enum type generated when choices have named groups. #339
Comments
wasn't aware of that django feature. yes we should account for that. the right schema would then be |
@tfranzel Yes you are right. Check out django.db.models.fields.Field._check_choices to see how django parse |
@elonzh so there is indeed a small bug in how did you use |
Sorry, maybe it's my mistake, My choices are generated and I can't reproduce this issue now. |
Describe the bug
According to Django document,
choices
supports named groups but drf-spectacular can not generate right schema.To Reproduce
For example:
will be generated as:
Expected behavior
generates the right schema.
The text was updated successfully, but these errors were encountered: