Skip to content

Commit 33bc36a

Browse files
author
Constantinos Symeonides
committed
refactor: Avoid breaking change
1 parent 57c42a8 commit 33bc36a

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_file_tests_upload_post.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def sync_detailed(
6262
) -> Response[Union[HTTPValidationError, None]]:
6363
kwargs = _get_kwargs(
6464
client=client,
65-
multipart_body=multipart_body,
65+
multipart_data=multipart_data,
6666
keep_alive=keep_alive,
6767
)
6868

@@ -83,7 +83,7 @@ def sync(
8383

8484
return sync_detailed(
8585
client=client,
86-
multipart_body=multipart_body,
86+
multipart_data=multipart_data,
8787
keep_alive=keep_alive,
8888
).parsed
8989

@@ -96,7 +96,7 @@ async def asyncio_detailed(
9696
) -> Response[Union[HTTPValidationError, None]]:
9797
kwargs = _get_kwargs(
9898
client=client,
99-
multipart_body=multipart_body,
99+
multipart_data=multipart_data,
100100
keep_alive=keep_alive,
101101
)
102102

@@ -117,7 +117,7 @@ async def asyncio(
117117
return (
118118
await asyncio_detailed(
119119
client=client,
120-
multipart_body=multipart_body,
120+
multipart_data=multipart_data,
121121
keep_alive=keep_alive,
122122
)
123123
).parsed

openapi_python_client/templates/endpoint_macros.py.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ client=client,
130130
form_data=form_data,
131131
{% endif %}
132132
{% if endpoint.multipart_body %}
133-
multipart_body=multipart_body,
133+
multipart_data=multipart_data,
134134
{% endif %}
135135
{% if endpoint.json_body %}
136136
json_body=json_body,

openapi_python_client/templates/property_templates/list_property.py.jinja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ for {{ inner_source }} in {{ source }}:
4242

4343
{% macro transform(property, source, destination, declare_type=True, stringify=False) %}
4444
{% set inner_property = property.inner_property %}
45-
{% set type_string = property.get_type_string(json=True) %}
4645
{% if stringify %}
4746
{% set type_string = "Union[Unset, Tuple[None, str, str]]" %}
47+
{% else %}
48+
{% set type_string = property.get_type_string(json=True) %}
4849
{% endif %}
4950
{% if property.required %}
5051
{% if property.nullable %}

openapi_python_client/templates/property_templates/model_property.py.jinja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212

1313
{% macro transform(property, source, destination, declare_type=True, stringify=False, transform_method="to_dict") %}
1414
{% set transformed = source + "." + transform_method + "()" %}
15-
{% set type_string = property.get_type_string(json=True) %}
1615
{% if stringify %}
1716
{% set transformed = "(None, json.dumps(" + transformed + "), 'application/json')" %}
1817
{% set type_string = "Union[Unset, Tuple[None, str, str]]" %}
18+
{% else %}
19+
{% set type_string = property.get_type_string(json=True) %}
1920
{% endif %}
2021
{% if property.required %}
2122
{% if property.nullable %}

0 commit comments

Comments
 (0)