Document exotic usages of swagger_auto_schema

method_decorator works out of the box so might as well document an example
This commit is contained in:
Cristi Vîjdea
2017-12-16 20:38:40 +01:00
parent a2c21539f7
commit 8a5be407e2
3 changed files with 42 additions and 1 deletions
+4
View File
@@ -1,5 +1,6 @@
import datetime
from django.utils.decorators import method_decorator
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import viewsets
from rest_framework.decorators import detail_route, list_route
@@ -19,6 +20,9 @@ class NoPagingAutoSchema(SwaggerAutoSchema):
return False
@method_decorator(name='list', decorator=swagger_auto_schema(
operation_description="description from swagger_auto_schema via method_decorator"
))
class ArticleViewSet(viewsets.ModelViewSet):
"""
ArticleViewSet class docstring