mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 00:49:49 +03:00
change tag name style to url path style
This commit is contained in:
parent
56178ed2a4
commit
912f22a46a
|
@ -587,7 +587,7 @@ class AutoSchema(ViewInspector):
|
|||
name = name[:-7]
|
||||
elif name.endswith('View'):
|
||||
name = name[:-4]
|
||||
return [camelcase_to_spaces(name).lower()]
|
||||
return [camelcase_to_spaces(name).lower().replace(' ', '-')]
|
||||
|
||||
# First element of a specific path could be valid tag. This is a fallback solution.
|
||||
# PUT, PATCH, GET(Retrieve), DELETE: /users/{id}/ tags = [users]
|
||||
|
@ -595,4 +595,4 @@ class AutoSchema(ViewInspector):
|
|||
if path.startswith('/'):
|
||||
path = path[1:]
|
||||
|
||||
return [path.split('/')[0].translate(str.maketrans({'-': ' ', '_': ' '}))]
|
||||
return [path.split('/')[0].replace('_', '-')]
|
||||
|
|
Loading…
Reference in New Issue
Block a user