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

Commit 15e66ee

Browse files
committed
Fixes skip_deserialization arg position
1 parent 6fb7bea commit 15e66ee

File tree

84 files changed

+145
-254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+145
-254
lines changed

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

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
self,
22
{{#if bodyParam}}
3-
{{#with bodyParam}}
4-
body: typing.Union[{{#each content}}{{#with this.schema}}{{baseName}},{{> model_templates/schema_python_types }}{{/with}}{{/each}}{{#unless required}}schemas.Unset] = schemas.unset{{else}}]{{/unless}},
5-
{{/with}}
6-
{{/if}}
7-
{{#if isOverload}}
8-
{{#eq skipDeserialization "True"}}
3+
{{#if bodyParam.required}}
4+
{{#with bodyParam}}
5+
body: typing.Union[{{#each content}}{{#with this.schema}}{{baseName}},{{> model_templates/schema_python_types }}{{/with}}{{/each}}],
6+
{{/with}}
7+
{{#if isOverload}}
8+
{{#eq skipDeserialization "True"}}
99
skip_deserialization: typing_extensions.Literal[True],
10-
{{/eq}}
10+
{{/eq}}
11+
{{/if}}
12+
{{else}}
13+
{{#if isOverload}}
14+
{{#eq skipDeserialization "True"}}
15+
skip_deserialization: typing_extensions.Literal[True],
16+
{{/eq}}
17+
{{/if}}
18+
{{#with bodyParam}}
19+
body: typing.Union[{{#each content}}{{#with this.schema}}{{baseName}},{{> model_templates/schema_python_types }}{{/with}}{{/each}}schemas.Unset] = schemas.unset,
20+
{{/with}}
1121
{{/if}}
22+
{{/if}}
1223
{{#if queryParams}}
1324
query_params: RequestQueryParams = frozendict.frozendict(),
1425
{{/if}}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.9
1+
unset

samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ def _group_parameters_oapg(
149149
@typing.overload
150150
def _group_parameters_oapg(
151151
self,
152-
skip_deserialization: typing_extensions.Literal[True],
153152
query_params: RequestQueryParams = frozendict.frozendict(),
154153
header_params: RequestHeaderParams = frozendict.frozendict(),
155154
stream: bool = False,
@@ -257,7 +256,6 @@ def group_parameters(
257256
@typing.overload
258257
def group_parameters(
259258
self,
260-
skip_deserialization: typing_extensions.Literal[True],
261259
query_params: RequestQueryParams = frozendict.frozendict(),
262260
header_params: RequestHeaderParams = frozendict.frozendict(),
263261
stream: bool = False,
@@ -312,7 +310,6 @@ def delete(
312310
@typing.overload
313311
def delete(
314312
self,
315-
skip_deserialization: typing_extensions.Literal[True],
316313
query_params: RequestQueryParams = frozendict.frozendict(),
317314
header_params: RequestHeaderParams = frozendict.frozendict(),
318315
stream: bool = False,

samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ class BaseApi(api_client.Api):
141141
@typing.overload
142142
def _group_parameters_oapg(
143143
self,
144-
skip_deserialization: typing_extensions.Literal[True],
145144
query_params: RequestQueryParams = frozendict.frozendict(),
146145
header_params: RequestHeaderParams = frozendict.frozendict(),
147146
stream: bool = False,
@@ -249,7 +248,6 @@ class GroupParameters(BaseApi):
249248
@typing.overload
250249
def group_parameters(
251250
self,
252-
skip_deserialization: typing_extensions.Literal[True],
253251
query_params: RequestQueryParams = frozendict.frozendict(),
254252
header_params: RequestHeaderParams = frozendict.frozendict(),
255253
stream: bool = False,
@@ -304,7 +302,6 @@ class ApiFordelete(BaseApi):
304302
@typing.overload
305303
def delete(
306304
self,
307-
skip_deserialization: typing_extensions.Literal[True],
308305
query_params: RequestQueryParams = frozendict.frozendict(),
309306
header_params: RequestHeaderParams = frozendict.frozendict(),
310307
stream: bool = False,

samples/openapi3/client/petstore/python/petstore_api/paths/fake/get.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,8 @@ def _enum_parameters_oapg(
470470
@typing.overload
471471
def _enum_parameters_oapg(
472472
self,
473-
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
474473
skip_deserialization: typing_extensions.Literal[True],
474+
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
475475
query_params: RequestQueryParams = frozendict.frozendict(),
476476
header_params: RequestHeaderParams = frozendict.frozendict(),
477477
content_type: str = 'application/x-www-form-urlencoded',
@@ -596,8 +596,8 @@ def enum_parameters(
596596
@typing.overload
597597
def enum_parameters(
598598
self,
599-
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
600599
skip_deserialization: typing_extensions.Literal[True],
600+
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
601601
query_params: RequestQueryParams = frozendict.frozendict(),
602602
header_params: RequestHeaderParams = frozendict.frozendict(),
603603
content_type: str = 'application/x-www-form-urlencoded',
@@ -661,8 +661,8 @@ def get(
661661
@typing.overload
662662
def get(
663663
self,
664-
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
665664
skip_deserialization: typing_extensions.Literal[True],
665+
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
666666
query_params: RequestQueryParams = frozendict.frozendict(),
667667
header_params: RequestHeaderParams = frozendict.frozendict(),
668668
content_type: str = 'application/x-www-form-urlencoded',

samples/openapi3/client/petstore/python/petstore_api/paths/fake/get.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ class BaseApi(api_client.Api):
403403
@typing.overload
404404
def _enum_parameters_oapg(
405405
self,
406-
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
407406
skip_deserialization: typing_extensions.Literal[True],
407+
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
408408
query_params: RequestQueryParams = frozendict.frozendict(),
409409
header_params: RequestHeaderParams = frozendict.frozendict(),
410410
content_type: str = 'application/x-www-form-urlencoded',
@@ -529,8 +529,8 @@ class EnumParameters(BaseApi):
529529
@typing.overload
530530
def enum_parameters(
531531
self,
532-
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
533532
skip_deserialization: typing_extensions.Literal[True],
533+
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
534534
query_params: RequestQueryParams = frozendict.frozendict(),
535535
header_params: RequestHeaderParams = frozendict.frozendict(),
536536
content_type: str = 'application/x-www-form-urlencoded',
@@ -594,8 +594,8 @@ class ApiForget(BaseApi):
594594
@typing.overload
595595
def get(
596596
self,
597-
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
598597
skip_deserialization: typing_extensions.Literal[True],
598+
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
599599
query_params: RequestQueryParams = frozendict.frozendict(),
600600
header_params: RequestHeaderParams = frozendict.frozendict(),
601601
content_type: str = 'application/x-www-form-urlencoded',

samples/openapi3/client/petstore/python/petstore_api/paths/fake/post.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ def _endpoint_parameters_oapg(
355355
@typing.overload
356356
def _endpoint_parameters_oapg(
357357
self,
358-
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
359358
skip_deserialization: typing_extensions.Literal[True],
359+
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
360360
content_type: str = 'application/x-www-form-urlencoded',
361361
stream: bool = False,
362362
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
@@ -447,8 +447,8 @@ def endpoint_parameters(
447447
@typing.overload
448448
def endpoint_parameters(
449449
self,
450-
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
451450
skip_deserialization: typing_extensions.Literal[True],
451+
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
452452
content_type: str = 'application/x-www-form-urlencoded',
453453
stream: bool = False,
454454
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
@@ -502,8 +502,8 @@ def post(
502502
@typing.overload
503503
def post(
504504
self,
505-
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
506505
skip_deserialization: typing_extensions.Literal[True],
506+
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
507507
content_type: str = 'application/x-www-form-urlencoded',
508508
stream: bool = False,
509509
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,

samples/openapi3/client/petstore/python/petstore_api/paths/fake/post.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ class BaseApi(api_client.Api):
306306
@typing.overload
307307
def _endpoint_parameters_oapg(
308308
self,
309-
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
310309
skip_deserialization: typing_extensions.Literal[True],
310+
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
311311
content_type: str = 'application/x-www-form-urlencoded',
312312
stream: bool = False,
313313
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
@@ -398,8 +398,8 @@ class EndpointParameters(BaseApi):
398398
@typing.overload
399399
def endpoint_parameters(
400400
self,
401-
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
402401
skip_deserialization: typing_extensions.Literal[True],
402+
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
403403
content_type: str = 'application/x-www-form-urlencoded',
404404
stream: bool = False,
405405
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
@@ -453,8 +453,8 @@ class ApiForpost(BaseApi):
453453
@typing.overload
454454
def post(
455455
self,
456-
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
457456
skip_deserialization: typing_extensions.Literal[True],
457+
body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded,dict, frozendict.frozendict, schemas.Unset] = schemas.unset,
458458
content_type: str = 'application/x-www-form-urlencoded',
459459
stream: bool = False,
460460
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,

samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ def _additional_properties_with_array_of_enums_oapg(
8484
@typing.overload
8585
def _additional_properties_with_array_of_enums_oapg(
8686
self,
87-
body: typing.Union[SchemaForRequestBodyApplicationJson,schemas.Unset] = schemas.unset,
8887
skip_deserialization: typing_extensions.Literal[True],
88+
body: typing.Union[SchemaForRequestBodyApplicationJson,schemas.Unset] = schemas.unset,
8989
content_type: str = 'application/json',
9090
accept_content_types: typing.Tuple[str] = _all_accept_content_types,
9191
stream: bool = False,
@@ -182,8 +182,8 @@ def additional_properties_with_array_of_enums(
182182
@typing.overload
183183
def additional_properties_with_array_of_enums(
184184
self,
185-
body: typing.Union[SchemaForRequestBodyApplicationJson,schemas.Unset] = schemas.unset,
186185
skip_deserialization: typing_extensions.Literal[True],
186+
body: typing.Union[SchemaForRequestBodyApplicationJson,schemas.Unset] = schemas.unset,
187187
content_type: str = 'application/json',
188188
accept_content_types: typing.Tuple[str] = _all_accept_content_types,
189189
stream: bool = False,
@@ -242,8 +242,8 @@ def get(
242242
@typing.overload
243243
def get(
244244
self,
245-
body: typing.Union[SchemaForRequestBodyApplicationJson,schemas.Unset] = schemas.unset,
246245
skip_deserialization: typing_extensions.Literal[True],
246+
body: typing.Union[SchemaForRequestBodyApplicationJson,schemas.Unset] = schemas.unset,
247247
content_type: str = 'application/json',
248248
accept_content_types: typing.Tuple[str] = _all_accept_content_types,
249249
stream: bool = False,

samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ class BaseApi(api_client.Api):
7979
@typing.overload
8080
def _additional_properties_with_array_of_enums_oapg(
8181
self,
82-
body: typing.Union[SchemaForRequestBodyApplicationJson,schemas.Unset] = schemas.unset,
8382
skip_deserialization: typing_extensions.Literal[True],
83+
body: typing.Union[SchemaForRequestBodyApplicationJson,schemas.Unset] = schemas.unset,
8484
content_type: str = 'application/json',
8585
accept_content_types: typing.Tuple[str] = _all_accept_content_types,
8686
stream: bool = False,
@@ -177,8 +177,8 @@ class AdditionalPropertiesWithArrayOfEnums(BaseApi):
177177
@typing.overload
178178
def additional_properties_with_array_of_enums(
179179
self,
180-
body: typing.Union[SchemaForRequestBodyApplicationJson,schemas.Unset] = schemas.unset,
181180
skip_deserialization: typing_extensions.Literal[True],
181+
body: typing.Union[SchemaForRequestBodyApplicationJson,schemas.Unset] = schemas.unset,
182182
content_type: str = 'application/json',
183183
accept_content_types: typing.Tuple[str] = _all_accept_content_types,
184184
stream: bool = False,
@@ -237,8 +237,8 @@ class ApiForget(BaseApi):
237237
@typing.overload
238238
def get(
239239
self,
240-
body: typing.Union[SchemaForRequestBodyApplicationJson,schemas.Unset] = schemas.unset,
241240
skip_deserialization: typing_extensions.Literal[True],
241+
body: typing.Union[SchemaForRequestBodyApplicationJson,schemas.Unset] = schemas.unset,
242242
content_type: str = 'application/json',
243243
accept_content_types: typing.Tuple[str] = _all_accept_content_types,
244244
stream: bool = False,

0 commit comments

Comments
 (0)