-
Notifications
You must be signed in to change notification settings - Fork 272
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
Strange behaviour of enums with integer choices #1104
Comments
somewhat related to #790 It is a problem that got elevated to a bug since we were adding labels to the description string. This of course can lead to wrong/confusing components. I'm aware and trying to come up with a fix for it soon. |
@tfranzel Thank you for looking into this. This is still one of the main problems we are facing in an otherwise very helpful and great package! |
It would be helpful if you guys could try out #1113 It introduces an Id into the schema for keeping track of the enum so the mix-up of similar enums does not happen anymore. Those Ids are then cleared afterwards via hook. |
#1113 Fixes this error for us. Thank you! |
I know drf-spectacular optimizes enums so that among enums with the same choices only one will be left.
But in our project we use
IntegerChoices
and right now it makes the team to add literally every second enum toENUM_NAME_OVERRIDES
. This is a huge inconvenience in big projects.Here is some example:
Maybe you should also check the labels of choices to determine, which choice sets are "similar"? Or at least you could make this the default behaviour when dealing with integer choices/enums, since they generally have similar choices.
The text was updated successfully, but these errors were encountered: