Skip to content

Commit 24a9504

Browse files
author
Marco Müllner
committed
chore: Fixed formatting
1 parent fa02681 commit 24a9504

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/openapi_python_generator/language_converters/python/service_generator.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import re
2-
from typing import Dict, Optional
2+
from typing import Dict
33
from typing import List
44
from typing import Literal
5+
from typing import Optional
56
from typing import Tuple
67
from typing import Union
78

@@ -154,13 +155,17 @@ def _generate_params_from_content(content: Union[Reference, Schema]):
154155
return params + default_params
155156

156157

157-
def generate_operation_id(operation: Operation, http_op: str, path_name: Optional[str] = None) -> str:
158+
def generate_operation_id(
159+
operation: Operation, http_op: str, path_name: Optional[str] = None
160+
) -> str:
158161
if operation.operationId is not None:
159162
return common.normalize_symbol(operation.operationId)
160163
elif path_name is not None:
161164
return common.normalize_symbol(f"{http_op}_{path_name}")
162165
else:
163-
raise Exception(f"OperationId is not defined for {http_op} of path_name {path_name} --> {operation.summary}") # pragma: no cover
166+
raise Exception(
167+
f"OperationId is not defined for {http_op} of path_name {path_name} --> {operation.summary}"
168+
) # pragma: no cover
164169

165170

166171
def _generate_params(
@@ -269,7 +274,7 @@ def generate_service_operation(
269274
op: Operation, path_name: str, async_type: bool
270275
) -> ServiceOperation:
271276
params = generate_params(op)
272-
operation_id = generate_operation_id(op, http_operation,path_name)
277+
operation_id = generate_operation_id(op, http_operation, path_name)
273278
query_params = generate_query_params(op)
274279
header_params = generate_header_params(op)
275280
return_type = generate_return_type(op)

tests/regression/test_issue_51.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ def test_issue_11(runner: CliRunner, model_data_with_cleanup, library) -> None:
2424
assert (
2525
generate_data(test_data_folder / "issue_51.json", test_result_path, library)
2626
is None
27-
)
27+
)

tests/test_data/issue_51.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,4 +477,4 @@
477477
"title": "Sample API",
478478
"version": "1.0.0"
479479
}
480-
}
480+
}

0 commit comments

Comments
 (0)