Skip to content

Commit 03d3406

Browse files
committed
rebased on master
1 parent 6e072db commit 03d3406

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

docs/api-guide/schemas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ If you need more configuration over the `operationId` field, you can override th
310310

311311
```python
312312
class CustomSchema(AutoSchema):
313-
def get_operation_id_base(self, action):
313+
def get_operation_id_base(self, path, method, action):
314314
pass
315315

316316
def get_operation_id(self, path, method):

rest_framework/schemas/openapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def get_operation(self, path, method):
115115

116116
return operation
117117

118-
def get_operation_id_base(self, action):
118+
def get_operation_id_base(self, path, method, action):
119119
"""
120120
Compute the base part for operation ID from the model, serializer or view name.
121121
"""
@@ -164,7 +164,7 @@ def get_operation_id(self, path, method):
164164
else:
165165
action = self.method_mapping[method.lower()]
166166

167-
name = self.get_operation_id_base(action)
167+
name = self.get_operation_id_base(path, method, action)
168168

169169
return action + name
170170

tests/schemas/test_openapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ def get_operation_id(self, path, method):
627627

628628
def test_operation_id_override_base(self):
629629
class CustomSchema(AutoSchema):
630-
def get_operation_id_base(self, action):
630+
def get_operation_id_base(self, path, method, action):
631631
return 'Item'
632632

633633
path = '/'

0 commit comments

Comments
 (0)