Skip to content

Commit 0cd9b2d

Browse files
committed
ci: regenerated with OpenAPI Doc 0.1.0, Speakeay CLI 0.17.4
1 parent e7a7185 commit 0cd9b2d

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

gen.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
management:
22
openapi-checksum: 8e8183d84cace76310a3208e63cd7855
33
openapi-version: 0.1.0
4-
speakeasy-version: 0.17.2
4+
speakeasy-version: 0.17.4
55
python:
66
author: Speakeasy
77
description: Speakeasy API Client SDK for Python
88
packagename: speakeasy-client-sdk-python
9-
version: 0.9.0
9+
version: 0.9.1
1010
telemetryenabled: null

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setuptools.setup(
1010
name="speakeasy-client-sdk-python",
11-
version="0.9.0",
11+
version="0.9.1",
1212
author="Speakeasy",
1313
description="Speakeasy API Client SDK for Python",
1414
long_description=long_description,

src/sdk/sdk.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class SDK:
3333
_security: shared.Security
3434
_server_url: str = SERVERS[SERVER_PROD]
3535
_language: str = "python"
36-
_sdk_version: str = "0.9.0"
37-
_gen_version: str = "0.17.2"
36+
_sdk_version: str = "0.9.1"
37+
_gen_version: str = "0.17.4"
3838

3939
def __init__(self) -> None:
4040
self._client = requests.Session()

src/sdk/utils/utils.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ def get_query_params(query_params: dataclass) -> dict[str, list[str]]:
203203

204204
param_name = f.name
205205
f_name = metadata.get("field_name")
206-
207206
serialization = metadata.get('serialization', '')
208207
if serialization != '':
209208
params = params | _get_serialized_query_params(
@@ -246,7 +245,6 @@ def _get_serialized_query_params(metadata: dict, field_name: str, obj: any) -> d
246245
params: dict[str, list[str]] = {}
247246

248247
serialization = metadata.get('serialization', '')
249-
250248
if serialization == 'json':
251249
params[metadata.get("field_name", field_name)] = marshal_json(obj)
252250

@@ -520,7 +518,6 @@ def serialize_form(data: dataclass, meta_string: str) -> dict[str, any]:
520518

521519
f_name = metadata["field_name"]
522520
if is_dataclass(value):
523-
print(f_name)
524521
if "style" not in metadata or ("json" in metadata and metadata["json"] is True):
525522
if f_name not in form:
526523
form[f_name] = []
@@ -530,9 +527,15 @@ def serialize_form(data: dataclass, meta_string: str) -> dict[str, any]:
530527
form = form | serialize_form(value, "form")
531528

532529
elif isinstance(value, dict):
533-
serialize_dict(value, metadata["explode"], f_name, form)
530+
if "json" in metadata and metadata["json"] is True:
531+
if f_name not in form:
532+
form[f_name] = []
533+
form[f_name].append(json.dumps(value))
534+
else:
535+
explode = "explode" in metadata and metadata["explode"] is True
536+
serialize_dict(value, explode, f_name, form)
534537
elif isinstance(value, list):
535-
if metadata["explode"] is True:
538+
if "explode" in metadata and metadata["explode"] is True:
536539
if f_name not in form:
537540
form[f_name] = []
538541
for item in value:
@@ -594,7 +597,12 @@ def _populate_form(field_name: str, explode: boolean, obj: any, get_field_name_f
594597
items = []
595598
for key, value in obj.items():
596599
if explode:
597-
params[key] = value
600+
# Python uses True and False instead of true and false for booleans;
601+
# This json encodes the values _only_ if the value is a boolean.
602+
if value is True or value is False:
603+
params[key] = json.dumps(value)
604+
else:
605+
params[key] = value
598606
else:
599607
items.append(f'{key},{value}')
600608

0 commit comments

Comments
 (0)