|
1 | 1 | import re |
2 | | -from typing import Dict, Optional |
| 2 | +from typing import Dict |
3 | 3 | from typing import List |
4 | 4 | from typing import Literal |
| 5 | +from typing import Optional |
5 | 6 | from typing import Tuple |
6 | 7 | from typing import Union |
7 | 8 |
|
@@ -154,13 +155,17 @@ def _generate_params_from_content(content: Union[Reference, Schema]): |
154 | 155 | return params + default_params |
155 | 156 |
|
156 | 157 |
|
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: |
158 | 161 | if operation.operationId is not None: |
159 | 162 | return common.normalize_symbol(operation.operationId) |
160 | 163 | elif path_name is not None: |
161 | 164 | return common.normalize_symbol(f"{http_op}_{path_name}") |
162 | 165 | 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 |
164 | 169 |
|
165 | 170 |
|
166 | 171 | def _generate_params( |
@@ -269,7 +274,7 @@ def generate_service_operation( |
269 | 274 | op: Operation, path_name: str, async_type: bool |
270 | 275 | ) -> ServiceOperation: |
271 | 276 | 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) |
273 | 278 | query_params = generate_query_params(op) |
274 | 279 | header_params = generate_header_params(op) |
275 | 280 | return_type = generate_return_type(op) |
|
0 commit comments