django-rest-swagger
django-rest-swagger copied to clipboard
Hide some classes from doc
Hi,
I have Django 2.1 and latest DRF. I installed latest django-rest-swagger.
I have some APIs in CBV. My urls.py use path instead of url like below which is similar to urls.py from https://docs.djangoproject.com/en/2.2/intro/overview/
from . import views
from rest_framework_swagger.views import get_swagger_view
schema_view = get_swagger_view(title='Demo Swagger API')
urlpatterns = [
path('users', UserView.as_view(), name='user'),
path('users/<int:year>/', UserView.as_view(), name='user_yearwise'),
path('swagger/', schema_view)
]
I tried below code in views.py for
from rest_framework.views import APIView
class UserView(APIView):
exclude_from_schema = True
def post(self, request):
#do stuff
But it is not working. what am I doing wrong?