drf-forms/drf-schema-adapter

Object of type Gender is not JSON serializable when calling OPTIONS request

Closed this issue · 1 comments

Hello
I just figure out that when I remove:
'DEFAULT_METADATA_CLASS': 'drf_auto_endpoint.metadata.AutoMetadata',
from settings. OPTIONS request is displayed well.
Here is the description of my old issue related to django-enumfields:

#hzdg/django-enumfields#126
Maybe incompatibility with django-enumfields ?
Same problem with django-money library: I use a moneyfield in serializer and get Object Money is not json serializable only in Options request. all other requests (get, post, ..) are working well.

Thanks for your answers

I would need more info to give an actual full answer but the message "is not JSON serializable" is coming from DRF, not this library.

I understand that this only happens when using drf_auto_endpoint.metadata.AutoMetadata but, under the hood, this class, just uses DRF.

Without more information, I would say that the issue can probably be solved by using a custom adapter That would have support for that field. But I am not sure what adapter you are using to start with.

Unless you can produce a re-producible piece of code, this is all the information I can give