Skip to content

Commit 7b1c131

Browse files
committed
Allow to override tag as the grouping mechanism per endpoint using the 'x-code-tag' property on the operation
1 parent 6cbe325 commit 7b1c131

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openapi_python_client/parser/openapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def from_data(
5757
operation: Optional[oai.Operation] = getattr(path_data, method)
5858
if operation is None:
5959
continue
60-
tag = utils.PythonIdentifier(value=(operation.tags or ["default"])[0], prefix="tag")
60+
tag = utils.PythonIdentifier(value=operation.__dict__.get('x-code-tag') or (operation.tags or ["default"])[0], prefix="tag")
6161
collection = endpoints_by_tag.setdefault(tag, EndpointCollection(tag=tag))
6262
endpoint, schemas, parameters = Endpoint.from_data(
6363
data=operation,

0 commit comments

Comments
 (0)