I'm using swagger-auto-schema to document my endpoints API using django-rest-framework, swagger, and drf-yasg. Is there a way to mark the API endpoints in the documentation as deprecated?
I'm using swagger-auto-schema to document my endpoints API using django-rest-framework, swagger, and drf-yasg. Is there a way to mark the API endpoints in the documentation as deprecated?
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)