forked from loafle/openapi-generator-original
[python][Feat] Deserialize error responses (#17038)
* refactor: Clean up _response_types_map formatting It matches black's behavior of having trailing commas now. * test: Add test to reproduce #16967 * fix: deserialize responses even if no returnType Closes #16967 * refactor: Simplify ApiException subclasses * refactor: Move exception subtype choice to ApiException * feat: Deserialize error responses and add to exceptions * test: Add for error responses with model
This commit is contained in:
@@ -93,8 +93,7 @@ class AuthApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -157,8 +156,7 @@ class AuthApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -221,8 +219,7 @@ class AuthApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
|
||||
@@ -101,8 +101,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "bytearray"
|
||||
|
||||
'200': "bytearray",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -165,8 +164,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "bytearray"
|
||||
|
||||
'200': "bytearray",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -229,8 +227,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "bytearray"
|
||||
|
||||
'200': "bytearray",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -351,8 +348,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -419,8 +415,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -487,8 +482,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -630,8 +624,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -698,8 +691,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -766,8 +758,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -905,8 +896,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "Pet"
|
||||
|
||||
'200': "Pet",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -973,8 +963,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "Pet"
|
||||
|
||||
'200': "Pet",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1041,8 +1030,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "Pet"
|
||||
|
||||
'200': "Pet",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1179,8 +1167,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1247,8 +1234,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1315,8 +1301,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1453,8 +1438,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "Pet"
|
||||
|
||||
'200': "Pet",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1521,8 +1505,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "Pet"
|
||||
|
||||
'200': "Pet",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1589,8 +1572,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "Pet"
|
||||
|
||||
'200': "Pet",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1727,8 +1709,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1795,8 +1776,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1863,8 +1843,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -2001,8 +1980,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -2069,8 +2047,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -2137,8 +2114,7 @@ class BodyApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
|
||||
@@ -109,8 +109,7 @@ class FormApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -185,8 +184,7 @@ class FormApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -261,8 +259,7 @@ class FormApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -425,8 +422,7 @@ class FormApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -513,8 +509,7 @@ class FormApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -601,8 +596,7 @@ class FormApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
|
||||
@@ -118,8 +118,7 @@ class HeaderApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -202,8 +201,7 @@ class HeaderApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -286,8 +284,7 @@ class HeaderApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
|
||||
@@ -112,8 +112,7 @@ class PathApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -192,8 +191,7 @@ class PathApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -272,8 +270,7 @@ class PathApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
|
||||
@@ -110,8 +110,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -182,8 +181,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -254,8 +252,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -394,8 +391,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -470,8 +466,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -546,8 +541,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -709,8 +703,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -785,8 +778,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -861,8 +853,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -998,8 +989,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1066,8 +1056,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1134,8 +1123,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1261,8 +1249,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1329,8 +1316,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1397,8 +1383,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1524,8 +1509,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1592,8 +1576,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1660,8 +1643,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1787,8 +1769,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1855,8 +1836,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -1923,8 +1903,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -2050,8 +2029,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -2118,8 +2096,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -2186,8 +2163,7 @@ class QueryApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "str"
|
||||
|
||||
'200': "str",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
|
||||
Reference in New Issue
Block a user