Exclude swagger docs for specific HTTP methods
问题 I use drf-yasg to generate swagger docs for my Django REST API. I have a couple of endpoints, items/ with GET, POST and DELETE methods; and items/<uuid:itemID> with DELETE method only. However, the generated swagger docs erroneously include also GET and POST for the latter endpoint. This is a snippet of what I have in urls.py: urlpatters = [ url(r'^items/$', views.ItemViewSet.as_view()), path('items/<uuid:itemID>', views.ItemViewSet.as_view()), ] views.py contains something like: class