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
Describe the bug
When declaring a DRF view decorated with @extend_schema, if the responses argument is a Pydantic model and the request argument is a DRF serializer, the response payload will be overwritten by that of the request serializer, both in Swagger and Redoc UI.
While testing to reproduce, I figured that it has something to do with the naming of the model and serializer. In the example below, if MyModel is renamed to something like MyPydanticModel, or something else that doesn't overlap with the initial portion of the serializer name MyModelSerializer, it seems to work properly.
Describe the bug
When declaring a DRF view decorated with
@extend_schema
, if theresponses
argument is a Pydantic model and therequest
argument is a DRF serializer, the response payload will be overwritten by that of the request serializer, both in Swagger and Redoc UI.While testing to reproduce, I figured that it has something to do with the naming of the model and serializer. In the example below, if
MyModel
is renamed to something likeMyPydanticModel
, or something else that doesn't overlap with the initial portion of the serializer nameMyModelSerializer
, it seems to work properly.To Reproduce
Expected behavior
The text was updated successfully, but these errors were encountered: