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
interesing usage of the choices parameter. I think people usually just drop in the UUID string in that case, but your solution is indeed a bit more robust. I think it is a good idea to employ the same serialization as the framework does.
…choices.
The crash was fixed by replacing the JSON encoder used to hash elements
for enum deduplication with DRF JSON encoder which is capable of handling
type outside of the usual JSON standard types.
Describe the bug
drf-spectacular crashes when generating a schema for a choice field with UUID options.
To Reproduce
Using drf-spectacular 0.26.4.
Create and API with the following serializer:
generating the schema for the API triggers:
Expected behavior
Expected the schema generation to succeed.
Possible fix
Change
list_hash
to use a JSON encoder that supports UUIDs likeDjangoJSONEncoder
.The text was updated successfully, but these errors were encountered: