diff --git a/rest_framework/schemas/openapi.py b/rest_framework/schemas/openapi.py index 134df50434..2f3bbe3803 100644 --- a/rest_framework/schemas/openapi.py +++ b/rest_framework/schemas/openapi.py @@ -47,11 +47,13 @@ def get_paths(self, request=None): operation = view.schema.get_operation(path, method) # Normalise path for any provided mount url. if path.startswith('/'): + tags = [path.split('/')[1]] path = path[1:] path = urljoin(self.url or '/', path) result.setdefault(path, {}) result[path][method.lower()] = operation + result[path][method.lower()].update(tags=tags) return result