Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,12 @@ class ApiClient:
# if not found, look for '1XX', '2XX', etc.
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)

# If the response_type has not matched (eg. did not match the previous if statements) and the default response is available, use it.
if response_type is None and str(response_data.status) not in response_types_map \
Comment thread
EraYaN marked this conversation as resolved.
and (not isinstance(response_data.status, int) or not 100 <= response_data.status <= 599 or str(response_data.status)[0] + "XX" not in response_types_map) \
and 'default' in response_types_map:
response_type = response_types_map['default']

# deserialize response data
response_text = None
return_data = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,10 @@
{{^isWildcard}}
'{{code}}': {{#dataType}}"{{.}}"{{/dataType}}{{^dataType}}None{{/dataType}},
{{/isWildcard}}
{{#isWildcard}}
{{#dataType}}
'default': "{{dataType}}",
{{/dataType}}
{{/isWildcard}}
{{/responses}}
}
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@ def response_deserialize(
# if not found, look for '1XX', '2XX', etc.
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)

# If the response_type has not matched (eg. did not match the previous if statements) and the default response is available, use it.
if response_type is None and str(response_data.status) not in response_types_map \
and (not isinstance(response_data.status, int) or not 100 <= response_data.status <= 599 or str(response_data.status)[0] + "XX" not in response_types_map) \
and 'default' in response_types_map:
response_type = response_types_map['default']

# deserialize response data
response_text = None
return_data = None
Expand Down
6 changes: 6 additions & 0 deletions samples/client/echo_api/python/openapi_client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@ def response_deserialize(
# if not found, look for '1XX', '2XX', etc.
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)

# If the response_type has not matched (eg. did not match the previous if statements) and the default response is available, use it.
if response_type is None and str(response_data.status) not in response_types_map \
and (not isinstance(response_data.status, int) or not 100 <= response_data.status <= 599 or str(response_data.status)[0] + "XX" not in response_types_map) \
and 'default' in response_types_map:
response_type = response_types_map['default']

# deserialize response data
response_text = None
return_data = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,12 @@ def response_deserialize(
# if not found, look for '1XX', '2XX', etc.
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)

# If the response_type has not matched (eg. did not match the previous if statements) and the default response is available, use it.
if response_type is None and str(response_data.status) not in response_types_map \
and (not isinstance(response_data.status, int) or not 100 <= response_data.status <= 599 or str(response_data.status)[0] + "XX" not in response_types_map) \
and 'default' in response_types_map:
response_type = response_types_map['default']

# deserialize response data
response_text = None
return_data = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ async def foo_get(
)

_response_types_map: Dict[str, Optional[str]] = {
'default': "FooGetDefaultResponse",
}
response_data = await self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -164,6 +165,7 @@ async def foo_get_with_http_info(
)

_response_types_map: Dict[str, Optional[str]] = {
'default': "FooGetDefaultResponse",
}
response_data = await self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -225,6 +227,7 @@ async def foo_get_without_preload_content(
)

_response_types_map: Dict[str, Optional[str]] = {
'default': "FooGetDefaultResponse",
}
response_data = await self.api_client.call_api(
*_param,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ def response_deserialize(
# if not found, look for '1XX', '2XX', etc.
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)

# If the response_type has not matched (eg. did not match the previous if statements) and the default response is available, use it.
if response_type is None and str(response_data.status) not in response_types_map \
and (not isinstance(response_data.status, int) or not 100 <= response_data.status <= 599 or str(response_data.status)[0] + "XX" not in response_types_map) \
and 'default' in response_types_map:
response_type = response_types_map['default']

# deserialize response data
response_text = None
return_data = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ async def foo_get(
)

_response_types_map: Dict[str, Optional[str]] = {
'default': "FooGetDefaultResponse",
}
response_data = await self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -146,6 +147,7 @@ async def foo_get_with_http_info(
)

_response_types_map: Dict[str, Optional[str]] = {
'default': "FooGetDefaultResponse",
}
response_data = await self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -207,6 +209,7 @@ async def foo_get_without_preload_content(
)

_response_types_map: Dict[str, Optional[str]] = {
'default': "FooGetDefaultResponse",
}
response_data = await self.api_client.call_api(
*_param,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,12 @@ def response_deserialize(
# if not found, look for '1XX', '2XX', etc.
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)

# If the response_type has not matched (eg. did not match the previous if statements) and the default response is available, use it.
if response_type is None and str(response_data.status) not in response_types_map \
and (not isinstance(response_data.status, int) or not 100 <= response_data.status <= 599 or str(response_data.status)[0] + "XX" not in response_types_map) \
and 'default' in response_types_map:
response_type = response_types_map['default']

# deserialize response data
response_text = None
return_data = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ async def foo_get(
)

_response_types_map: Dict[str, Optional[str]] = {
'default': "FooGetDefaultResponse",
}
response_data = await self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -145,6 +146,7 @@ async def foo_get_with_http_info(
)

_response_types_map: Dict[str, Optional[str]] = {
'default': "FooGetDefaultResponse",
}
response_data = await self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -206,6 +208,7 @@ async def foo_get_without_preload_content(
)

_response_types_map: Dict[str, Optional[str]] = {
'default': "FooGetDefaultResponse",
}
response_data = await self.api_client.call_api(
*_param,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,12 @@ def response_deserialize(
# if not found, look for '1XX', '2XX', etc.
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)

# If the response_type has not matched (eg. did not match the previous if statements) and the default response is available, use it.
if response_type is None and str(response_data.status) not in response_types_map \
and (not isinstance(response_data.status, int) or not 100 <= response_data.status <= 599 or str(response_data.status)[0] + "XX" not in response_types_map) \
and 'default' in response_types_map:
response_type = response_types_map['default']

# deserialize response data
response_text = None
return_data = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def foo_get(
)

_response_types_map: Dict[str, Optional[str]] = {
'default': "FooGetDefaultResponse",
}
response_data = self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -165,6 +166,7 @@ def foo_get_with_http_info(
)

_response_types_map: Dict[str, Optional[str]] = {
'default': "FooGetDefaultResponse",
}
response_data = self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -226,6 +228,7 @@ def foo_get_without_preload_content(
)

_response_types_map: Dict[str, Optional[str]] = {
'default': "FooGetDefaultResponse",
}
response_data = self.api_client.call_api(
*_param,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ def response_deserialize(
# if not found, look for '1XX', '2XX', etc.
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)

# If the response_type has not matched (eg. did not match the previous if statements) and the default response is available, use it.
if response_type is None and str(response_data.status) not in response_types_map \
and (not isinstance(response_data.status, int) or not 100 <= response_data.status <= 599 or str(response_data.status)[0] + "XX" not in response_types_map) \
and 'default' in response_types_map:
response_type = response_types_map['default']

# deserialize response data
response_text = None
return_data = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def foo_get(
)

_response_types_map: Dict[str, Optional[str]] = {
'default': "FooGetDefaultResponse",
}
response_data = self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -145,6 +146,7 @@ def foo_get_with_http_info(
)

_response_types_map: Dict[str, Optional[str]] = {
'default': "FooGetDefaultResponse",
}
response_data = self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -206,6 +208,7 @@ def foo_get_without_preload_content(
)

_response_types_map: Dict[str, Optional[str]] = {
'default': "FooGetDefaultResponse",
}
response_data = self.api_client.call_api(
*_param,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ def response_deserialize(
# if not found, look for '1XX', '2XX', etc.
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)

# If the response_type has not matched (eg. did not match the previous if statements) and the default response is available, use it.
if response_type is None and str(response_data.status) not in response_types_map \
and (not isinstance(response_data.status, int) or not 100 <= response_data.status <= 599 or str(response_data.status)[0] + "XX" not in response_types_map) \
and 'default' in response_types_map:
response_type = response_types_map['default']

# deserialize response data
response_text = None
return_data = None
Expand Down
Loading