drf-yasg icon indicating copy to clipboard operation
drf-yasg copied to clipboard

Swagger Auto Schema Decorator doesn't work

Open g-kartik opened this issue 3 years ago • 3 comments

I have the Swagger Auto Schema Decorator over create method in a RegisterViewEx. I described the responses with help of custom serializer. However the schema generated uses the serializer specified in APIView class. It doesn't use the one described in the decorator. Its does not update.

The view class image

The super view class image

Response serializer, two new fields and password1 and password2 fields removed image

Response fields are incorrect image

g-kartik avatar Dec 28 '21 17:12 g-kartik

Maintainers and contributors, can you please help me with this issue? @axnsan12 @JoelLefkowitz

g-kartik avatar Dec 29 '21 05:12 g-kartik

I suspect this is a problem in the way you're using Django REST Framework, not drf-yasg. Can you make sure that the schema you're showing there is generated by introspecting the restricted permissions view class, and not the original superclass? Also, I'm not sure you can remove attributes from a class just by setting them to None.

PaulWay avatar Feb 07 '22 03:02 PaulWay

It does not work with create() i am guessing . make it a post() . then it will work .

DigantaBiswas avatar May 22 '23 10:05 DigantaBiswas