mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 17:00:43 +00:00
[python] fix content_type deserialize (#19317)
* [Python] fix: #19285 * [python] update sample * [python] add test * [python] remove test
This commit is contained in:
@@ -405,12 +405,12 @@ class ApiClient:
|
||||
data = json.loads(response_text)
|
||||
except ValueError:
|
||||
data = response_text
|
||||
elif content_type.startswith("application/json"):
|
||||
elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
|
||||
if response_text == "":
|
||||
data = ""
|
||||
else:
|
||||
data = json.loads(response_text)
|
||||
elif content_type.startswith("text/plain"):
|
||||
elif re.match(r'^text/plain\s*(;|$)', content_type, re.IGNORECASE):
|
||||
data = response_text
|
||||
else:
|
||||
raise ApiException(
|
||||
|
||||
Reference in New Issue
Block a user