DRF-YASG creates an entry for a blocked method of a URL.
Is this a regression?
No, it is not.
Minimal Reproduction
views.py
class FooView(APIView):
def get(self, request):
...
def post(self, request):
...
urls.py
urlpatterns = [
...
path("foo/", views.FooView.as_view()), # all methods found in view class allowed, as per default, we need both GET and POST here
path("foo/bar/", views.FooView.as_view(http_method_names=['get'])), # only GET allowed
]
Result
The POST to foo/bar/ (last entry on image - foo_bar_create) should not be shown, as this URL has no POST in list of allowed methods (DRF will return HTTP "405 Method Not Allowed" as it should).
Bug Report
Description
DRF-YASG creates an entry for a blocked method of a URL.
Is this a regression?
No, it is not.
Minimal Reproduction
views.py
urls.py
Result
The POST to
foo/bar/
(last entry on image -foo_bar_create
) should not be shown, as this URL has no POST in list of allowed methods (DRF will return HTTP "405 Method Not Allowed" as it should).Your Environment