mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
Allow to pass a str to the Python aiohttp client (#18985)
* see #18972 Add support for `str` * update python samples --------- Co-authored-by: David Riccitelli <david@wordlift.io>
This commit is contained in:
parent
4e89436177
commit
1064cb6a68
@ -177,10 +177,10 @@ class RESTClientObject:
|
||||
data.add_field(k, v)
|
||||
args["data"] = data
|
||||
|
||||
# Pass a `bytes` parameter directly in the body to support
|
||||
# Pass a `bytes` or `str` parameter directly in the body to support
|
||||
# other content types than Json when `body` argument is provided
|
||||
# in serialized form
|
||||
elif isinstance(body, bytes):
|
||||
elif isinstance(body, str) or isinstance(body, bytes):
|
||||
args["data"] = body
|
||||
else:
|
||||
# Cannot generate the request from given parameters
|
||||
|
@ -187,10 +187,10 @@ class RESTClientObject:
|
||||
data.add_field(k, v)
|
||||
args["data"] = data
|
||||
|
||||
# Pass a `bytes` parameter directly in the body to support
|
||||
# Pass a `bytes` or `str` parameter directly in the body to support
|
||||
# other content types than Json when `body` argument is provided
|
||||
# in serialized form
|
||||
elif isinstance(body, bytes):
|
||||
elif isinstance(body, str) or isinstance(body, bytes):
|
||||
args["data"] = body
|
||||
else:
|
||||
# Cannot generate the request from given parameters
|
||||
|
Loading…
x
Reference in New Issue
Block a user