forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/5.3.x' into 6.0.x
This commit is contained in:
@@ -1 +1,5 @@
|
||||
6.0.0-SNAPSHOT
|
||||
<<<<<<< HEAD
|
||||
6.0.0-SNAPSHOT
|
||||
=======
|
||||
5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
@@ -55,8 +55,8 @@ class UsageApi(object):
|
||||
_preload_content (bool): if False, the urllib3.HTTPResponse object
|
||||
will be returned without reading/decoding response data.
|
||||
Default is True.
|
||||
_request_timeout (float/tuple): timeout setting for this request. If one
|
||||
number provided, it will be total request timeout. It can also
|
||||
_request_timeout (int/float/tuple): timeout setting for this request. If
|
||||
one number provided, it will be total request timeout. It can also
|
||||
be a pair (tuple) of (connection, read) timeouts.
|
||||
Default is None.
|
||||
_check_input_type (bool): specifies if type checking
|
||||
@@ -209,8 +209,8 @@ class UsageApi(object):
|
||||
_preload_content (bool): if False, the urllib3.HTTPResponse object
|
||||
will be returned without reading/decoding response data.
|
||||
Default is True.
|
||||
_request_timeout (float/tuple): timeout setting for this request. If one
|
||||
number provided, it will be total request timeout. It can also
|
||||
_request_timeout (int/float/tuple): timeout setting for this request. If
|
||||
one number provided, it will be total request timeout. It can also
|
||||
be a pair (tuple) of (connection, read) timeouts.
|
||||
Default is None.
|
||||
_check_input_type (bool): specifies if type checking
|
||||
|
||||
@@ -129,7 +129,7 @@ class ApiClient(object):
|
||||
_return_http_data_only: typing.Optional[bool] = None,
|
||||
collection_formats: typing.Optional[typing.Dict[str, str]] = None,
|
||||
_preload_content: bool = True,
|
||||
_request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
|
||||
_request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None,
|
||||
_host: typing.Optional[str] = None,
|
||||
_check_type: typing.Optional[bool] = None
|
||||
):
|
||||
@@ -347,7 +347,7 @@ class ApiClient(object):
|
||||
_return_http_data_only: typing.Optional[bool] = None,
|
||||
collection_formats: typing.Optional[typing.Dict[str, str]] = None,
|
||||
_preload_content: bool = True,
|
||||
_request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
|
||||
_request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None,
|
||||
_host: typing.Optional[str] = None,
|
||||
_check_type: typing.Optional[bool] = None
|
||||
):
|
||||
@@ -674,7 +674,7 @@ class Endpoint(object):
|
||||
'async_req': (bool,),
|
||||
'_host_index': (none_type, int),
|
||||
'_preload_content': (bool,),
|
||||
'_request_timeout': (none_type, int, (int,), [int]),
|
||||
'_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]),
|
||||
'_return_http_data_only': (bool,),
|
||||
'_check_input_type': (bool,),
|
||||
'_check_return_type': (bool,)
|
||||
|
||||
@@ -47,7 +47,7 @@ def convert_js_args_to_python_args(fn):
|
||||
|
||||
class cached_property(object):
|
||||
# this caches the result of the function call for fn with no inputs
|
||||
# use this as a decorator on fuction methods that you want converted
|
||||
# use this as a decorator on function methods that you want converted
|
||||
# into cached properties
|
||||
result_key = '_results'
|
||||
|
||||
@@ -1632,12 +1632,20 @@ def model_to_dict(model_instance, serialize=True):
|
||||
model_instances = [model_instance]
|
||||
if model_instance._composed_schemas:
|
||||
model_instances.extend(model_instance._composed_instances)
|
||||
seen_json_attribute_names = set()
|
||||
used_fallback_python_attribute_names = set()
|
||||
py_to_json_map = {}
|
||||
for model_instance in model_instances:
|
||||
for attr, value in model_instance._data_store.items():
|
||||
if serialize:
|
||||
# we use get here because additional property key names do not
|
||||
# exist in attribute_map
|
||||
attr = model_instance.attribute_map.get(attr, attr)
|
||||
try:
|
||||
attr = model_instance.attribute_map[attr]
|
||||
py_to_json_map.update(model_instance.attribute_map)
|
||||
seen_json_attribute_names.add(attr)
|
||||
except KeyError:
|
||||
used_fallback_python_attribute_names.add(attr)
|
||||
if isinstance(value, list):
|
||||
if not value:
|
||||
# empty list or None
|
||||
@@ -1665,6 +1673,16 @@ def model_to_dict(model_instance, serialize=True):
|
||||
result[attr] = model_to_dict(value, serialize=serialize)
|
||||
else:
|
||||
result[attr] = value
|
||||
if serialize:
|
||||
for python_key in used_fallback_python_attribute_names:
|
||||
json_key = py_to_json_map.get(python_key)
|
||||
if json_key is None:
|
||||
continue
|
||||
if python_key == json_key:
|
||||
continue
|
||||
json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names
|
||||
if json_key_assigned_no_need_for_python_key:
|
||||
del result[python_key]
|
||||
|
||||
return result
|
||||
|
||||
|
||||
@@ -137,15 +137,15 @@ class RESTClientObject(object):
|
||||
timeout = urllib3.Timeout(
|
||||
connect=_request_timeout[0], read=_request_timeout[1])
|
||||
|
||||
if 'Content-Type' not in headers:
|
||||
headers['Content-Type'] = 'application/json'
|
||||
|
||||
try:
|
||||
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
|
||||
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
|
||||
# Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests
|
||||
if (method != 'DELETE') and ('Content-Type' not in headers):
|
||||
headers['Content-Type'] = 'application/json'
|
||||
if query_params:
|
||||
url += '?' + urlencode(query_params)
|
||||
if re.search('json', headers['Content-Type'], re.IGNORECASE):
|
||||
if ('Content-Type' not in headers) or (re.search('json', headers['Content-Type'], re.IGNORECASE)):
|
||||
request_body = None
|
||||
if body is not None:
|
||||
request_body = json.dumps(body)
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
6.0.0-SNAPSHOT
|
||||
<<<<<<< HEAD
|
||||
6.0.0-SNAPSHOT
|
||||
=======
|
||||
5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
@@ -8,7 +8,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
6.0.0-SNAPSHOT
|
||||
<<<<<<< HEAD
|
||||
6.0.0-SNAPSHOT
|
||||
=======
|
||||
5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -8,7 +8,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
<<<<<<< HEAD
|
||||
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
||||
=======
|
||||
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
=end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user