Skip to content
This repository was archived by the owner on Jan 11, 2021. It is now read-only.

Commit ac6d649

Browse files
committed
use enabled_methods option
1 parent 0b2b144 commit ac6d649

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rest_framework_swagger/docgenerator.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from .introspectors import APIViewIntrospector, \
88
ViewSetIntrospector, BaseMethodIntrospector, IntrospectorHelper, \
99
get_resolved_value, YAMLDocstringParser
10+
from . import SWAGGER_SETTINGS
1011

1112

1213
class DocumentationGenerator(object):
@@ -50,7 +51,8 @@ def get_operations(self, api):
5051

5152
for method_introspector in introspector:
5253
if not isinstance(method_introspector, BaseMethodIntrospector) or \
53-
method_introspector.get_http_method() == "OPTIONS":
54+
method_introspector.get_http_method() == "OPTIONS" or \
55+
method_introspector.get_http_method().lower() not in SWAGGER_SETTINGS['enabled_methods']:
5456
continue # No one cares. I impose JSON.
5557

5658
doc_parser = YAMLDocstringParser(

0 commit comments

Comments
 (0)