Tags override support (#259)

This commit is contained in:
Vitali Fokin authored and Cristi Vîjdea committed 2018-12-11 20:13:37 +02:00
1 parent c52daaea8c
commit f415a96aa6
5 files changed
+27 -13

No files matched your search

+7 -2
View File
@@ -376,13 +376,18 @@ class SwaggerAutoSchema(ViewInspector):
def get_tags(self, operation_keys):
"""Get a list of tags for this operation. Tags determine how operations relate with each other, and in the UI
each tag will show as a group containing the operations that use it.
each tag will show as a group containing the operations that use it. If not provided in overrides,
tags will be inferred from the operation url.
:param tuple[str] operation_keys: an array of keys derived from the pathdescribing the hierarchical layout
of this view in the API; e.g. ``('snippets', 'list')``, ``('snippets', 'retrieve')``, etc.
:rtype: list[str]
"""
return [operation_keys[0]]
tags = self.overrides.get('tags')
if not tags:
tags = [operation_keys[0]]
return tags
def get_consumes(self):
"""Return the MIME types this endpoint can consume.