forked from loafle/openapi-generator-original
[python] json like str response (#18069)
* [python] json like str response * [python] fix response deserialize * [python] update sample * [python] fix echo_api test quotes
This commit is contained in:
@@ -313,7 +313,10 @@ class ApiClient:
|
||||
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
|
||||
encoding = match.group(1) if match else "utf-8"
|
||||
response_text = response_data.data.decode(encoding)
|
||||
return_data = self.deserialize(response_text, response_type)
|
||||
if response_type in ["bytearray", "str"]:
|
||||
return_data = self.__deserialize_primitive(response_text, response_type)
|
||||
else:
|
||||
return_data = self.deserialize(response_text, response_type)
|
||||
finally:
|
||||
if not 200 <= response_data.status <= 299:
|
||||
raise ApiException.from_response(
|
||||
|
||||
Reference in New Issue
Block a user