From 8d3051d3a3f8ab90c41117b3075eda6fa4fcbfd9 Mon Sep 17 00:00:00 2001 From: Dhaval Mehta <20968146+dhaval-mehta@users.noreply.github.com> Date: Wed, 19 Feb 2020 22:12:36 +0530 Subject: [PATCH] add better example in comments --- rest_framework/schemas/openapi.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rest_framework/schemas/openapi.py b/rest_framework/schemas/openapi.py index 956d4a4d8..ce7577683 100644 --- a/rest_framework/schemas/openapi.py +++ b/rest_framework/schemas/openapi.py @@ -579,8 +579,9 @@ class AutoSchema(ViewInspector): return self._tags # Extract tag from viewset name - # UserView tags = [User] - # User tags = [User] + # UserProfileViewSet tags = [user-profile] + # UserProfileView tags = [user-profile] + # UserProfile tags = [user-profile] if hasattr(self.view, 'action'): name = self.view.__class__.__name__ if name.endswith('ViewSet'): @@ -590,8 +591,8 @@ class AutoSchema(ViewInspector): 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] - # POST, GET(List): /users/ tags = [users] + # PUT, PATCH, GET(Retrieve), DELETE: /user_profile/{id}/ tags = [user-profile] + # POST, GET(List): /user_profile/ tags = [user-profile] if path.startswith('/'): path = path[1:]