Skip to content

Commit 8ab70b4

Browse files
author
Anders Brams
committed
feat: simplify protocols when --no-requests and --no-responses
1 parent 0b078e5 commit 8ab70b4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

openapi_python/generator/render.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,11 @@ def _render_client(
373373
async_protocols: list[str] = []
374374
method_overloads: dict[str, list[str]] = {}
375375
async_method_overloads: dict[str, list[str]] = {}
376+
generate_operation_protocols = generate_routes and (
377+
generate_requests or generate_responses
378+
)
376379
for op in spec.operations:
377-
if generate_routes:
380+
if generate_operation_protocols:
378381
protocols.append(
379382
_protocol_block(
380383
op,

0 commit comments

Comments
 (0)