oxan / djangorestframework-dataclasses

Dataclasses serializer for Django REST framework
BSD 3-Clause "New" or "Revised" License
431 stars 28 forks source link

Bug with @swagger_auto_schema in drf-yasg #67

Closed Rfank2021 closed 1 year ago

Rfank2021 commented 1 year ago

If there are multiple nested different data classes in one data class, the swagger doc will only contain one nested data class type.

We can solve the problem by specifying the nested data class serializer manually. The annotation is here, https://drf-yasg.readthedocs.io/en/stable/custom_spec.html#the-swagger-auto-schema-decorator

oxan commented 1 year ago

Do you have any idea if and/or how this could be fixed in djangorestframework-dataclasses? It smells a lot like either a bug in or a bad interaction with drf-yasg (which I've never used).