[Answered ]-How to mark a method as deprecated with swagger_auto_schema?

1👍

You should set deprecated=True parameter on the swagger_auto_schema decorator.

Example:

class MyViewSet(viewsets.ModelViewSet):
    ...

    @swagger_auto_schema(deprecated=True)
    def list(self, request, *args, **kwargs):
        return super().list(request, *args, **kwargs)

Leave a comment