You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When storing the overriden choice hash the null and blank values are included in the hashing, while when the choices are processed in the enum hook the null and blank values get excluded. This leads to the hash values not matching and the override not being detected.
To Reproduce
Create a choices objects that contains a blank string as a valid value.
Describe the bug
ENUM_NAME_OVERRIDES
is not using the custom name specified for the enum if the choice values include a blank string as an option.This looks to be due to a difference in how the hashes are being computed for the choices in https://github.com/tfranzel/drf-spectacular/blob/master/drf_spectacular/plumbing.py#L778 and https://github.com/tfranzel/drf-spectacular/blob/master/drf_spectacular/hooks.py#L62.
When storing the overriden choice hash the null and blank values are included in the hashing, while when the choices are processed in the enum hook the null and blank values get excluded. This leads to the hash values not matching and the override not being detected.
To Reproduce
Create a choices objects that contains a blank string as a valid value.
Expected behavior
The name of the Answers choices in the schema should be
YesNoAnswerEnum
after applying the override.The text was updated successfully, but these errors were encountered: