Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit b1a22c5

Browse files
committed
Add back implementation type hint
1 parent ae398eb commit b1a22c5

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args.handlebars

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,36 @@
11
self,
22
{{#if bodyParam}}
33
{{#with bodyParam}}
4-
{{#if isOverload}}
54
body: typing.Union[{{#each content}}{{#with this.schema}}{{baseName}},{{> model_templates/schema_python_types }}{{/with}}{{/each}}{{#unless required}}schemas.Unset] = schemas.unset{{else}}]{{/unless}},
6-
{{else}}
7-
body{{#unless required}} = schemas.unset{{/unless}},
8-
{{/if}}
95
{{/with}}
106
{{/if}}
117
{{#if queryParams}}
12-
query_params{{#if isOverload}}: RequestQueryParams{{/if}} = frozendict.frozendict(),
8+
query_params: RequestQueryParams = frozendict.frozendict(),
139
{{/if}}
1410
{{#if headerParams}}
15-
header_params{{#if isOverload}}: RequestHeaderParams{{/if}} = frozendict.frozendict(),
11+
header_params: RequestHeaderParams = frozendict.frozendict(),
1612
{{/if}}
1713
{{#if pathParams}}
18-
path_params{{#if isOverload}}: RequestPathParams{{/if}} = frozendict.frozendict(),
14+
path_params: RequestPathParams = frozendict.frozendict(),
1915
{{/if}}
2016
{{#if cookieParams}}
21-
cookie_params{{#if isOverload}}: RequestCookieParams{{/if}} = frozendict.frozendict(),
17+
cookie_params: RequestCookieParams = frozendict.frozendict(),
2218
{{/if}}
2319
{{#with bodyParam}}
2420
{{#each content}}
2521
{{#if @first}}
26-
content_type{{#if isOverload}}: str{{/if}} = '{{{@key}}}',
22+
content_type: str = '{{{@key}}}',
2723
{{/if}}
2824
{{/each}}
2925
{{/with}}
3026
{{#if produces}}
31-
accept_content_types{{#if isOverload}}: typing.Tuple[str]{{/if}} = _all_accept_content_types,
27+
accept_content_types: typing.Tuple[str] = _all_accept_content_types,
3228
{{/if}}
3329
{{#if servers}}
34-
host_index{{#if isOverload}}: typing.Optional[int]{{/if}} = None,
30+
host_index: typing.Optional[int] = None,
3531
{{/if}}
36-
stream{{#if isOverload}}: bool{{/if}} = False,
37-
timeout{{#if isOverload}}: typing.Optional[typing.Union[int, typing.Tuple]]{{/if}} = None,
32+
stream: bool = False,
33+
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
3834
{{#if isOverload}}
3935
{{#eq skipDeserialization "True"}}
4036
skip_deserialization: typing_extensions.Literal[True] = True,
@@ -46,16 +42,16 @@
4642
skip_deserialization: bool = False,
4743
{{/eq}}
4844
{{else}}
49-
skip_deserialization = False,
45+
skip_deserialization: bool = False,
5046
{{/if}}
5147
{{#eq skipDeserialization "True"}}
5248
) -> api_client.ApiResponseWithoutDeserialization:
5349
{{/eq}}
5450
{{#eq skipDeserialization "False"}}
55-
) -> typing.Union[{{#each responses}}{{#if isDefault}}ApiResponseForDefault,{{else}}{{#if is2xx}}ApiResponseFor{{code}},{{/if}}{{/if}}{{/each}}api_client.ApiResponse,]:
51+
) -> typing.Union[{{#each responses}}{{#if isDefault}}ApiResponseForDefault,{{else}}{{#if is2xx}}ApiResponseFor{{code}},{{/if}}{{/if}}{{/each}}api_client.ApiResponse]:
5652
{{/eq}}
5753
{{#eq skipDeserialization "null"}}
58-
{{#if isOverload}}
54+
{{#if isOverload}}
5955
) -> typing.Union[
6056
{{#each responses}}
6157
{{#if isDefault}}
@@ -68,9 +64,21 @@
6864
{{/each}}
6965
api_client.ApiResponseWithoutDeserialization,
7066
]:
71-
{{else}}
72-
):
73-
{{/if}}
67+
{{else}}
68+
) -> typing.Union[
69+
{{#each responses}}
70+
{{#if isDefault}}
71+
ApiResponseForDefault,
72+
{{else}}
73+
{{#if is2xx}}
74+
ApiResponseFor{{code}},
75+
{{/if}}
76+
{{/if}}
77+
{{/each}}
78+
api_client.ApiResponse,
79+
api_client.ApiResponseWithoutDeserialization,
80+
]:
81+
{{/if}}
7482
{{/eq}}
7583
{{#if isOverload}}
7684
...

0 commit comments

Comments
 (0)