Skip to content

Commit

Permalink
fix: object serialization for multipart requests
Browse files Browse the repository at this point in the history
This PR is essentially
<OpenAPITools#18140> but for
the asyncio client.
  • Loading branch information
roryschadler committed Aug 7, 2024
1 parent 4b49335 commit 1c5ac78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ class RESTClientObject:
content_type=v[2]
)
else:
# Ensures that dict objects are serialized
if isinstance(v, dict):
v = json.dumps(v)
data.add_field(k, v)
args["data"] = data

Expand All @@ -198,8 +201,3 @@ class RESTClientObject:
r = await pool_manager.request(**args)

return RESTResponse(r)





Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ async def request(
content_type=v[2]
)
else:
# Ensures that dict objects are serialized
if isinstance(v, dict):
v = json.dumps(v)
data.add_field(k, v)
args["data"] = data

Expand All @@ -208,8 +211,3 @@ async def request(
r = await pool_manager.request(**args)

return RESTResponse(r)





0 comments on commit 1c5ac78

Please sign in to comment.