forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 6.0.x
This commit is contained in:
@@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
|
||||
|
||||
## Requirements.
|
||||
|
||||
Python >= 3.6
|
||||
Python >=3.6
|
||||
|
||||
## Installation & Usage
|
||||
### pip install
|
||||
|
||||
@@ -243,6 +243,10 @@ class UsageApi(object):
|
||||
_check_return_type (bool): specifies if type checking
|
||||
should be done one the data received from the server.
|
||||
Default is True.
|
||||
_spec_property_naming (bool): True if the variable names in the input data
|
||||
are serialized names, as specified in the OpenAPI document.
|
||||
False if the variable names in the input data
|
||||
are pythonic names, e.g. snake case (default)
|
||||
_content_type (str/None): force body content-type.
|
||||
Default is None and content-type will be predicted by allowed
|
||||
content-types and body.
|
||||
@@ -274,6 +278,9 @@ class UsageApi(object):
|
||||
kwargs['_check_return_type'] = kwargs.get(
|
||||
'_check_return_type', True
|
||||
)
|
||||
kwargs['_spec_property_naming'] = kwargs.get(
|
||||
'_spec_property_naming', False
|
||||
)
|
||||
kwargs['_content_type'] = kwargs.get(
|
||||
'_content_type')
|
||||
kwargs['_host_index'] = kwargs.get('_host_index')
|
||||
@@ -309,6 +316,10 @@ class UsageApi(object):
|
||||
_check_return_type (bool): specifies if type checking
|
||||
should be done one the data received from the server.
|
||||
Default is True.
|
||||
_spec_property_naming (bool): True if the variable names in the input data
|
||||
are serialized names, as specified in the OpenAPI document.
|
||||
False if the variable names in the input data
|
||||
are pythonic names, e.g. snake case (default)
|
||||
_content_type (str/None): force body content-type.
|
||||
Default is None and content-type will be predicted by allowed
|
||||
content-types and body.
|
||||
@@ -340,6 +351,9 @@ class UsageApi(object):
|
||||
kwargs['_check_return_type'] = kwargs.get(
|
||||
'_check_return_type', True
|
||||
)
|
||||
kwargs['_spec_property_naming'] = kwargs.get(
|
||||
'_spec_property_naming', False
|
||||
)
|
||||
kwargs['_content_type'] = kwargs.get(
|
||||
'_content_type')
|
||||
kwargs['_host_index'] = kwargs.get('_host_index')
|
||||
@@ -375,6 +389,10 @@ class UsageApi(object):
|
||||
_check_return_type (bool): specifies if type checking
|
||||
should be done one the data received from the server.
|
||||
Default is True.
|
||||
_spec_property_naming (bool): True if the variable names in the input data
|
||||
are serialized names, as specified in the OpenAPI document.
|
||||
False if the variable names in the input data
|
||||
are pythonic names, e.g. snake case (default)
|
||||
_content_type (str/None): force body content-type.
|
||||
Default is None and content-type will be predicted by allowed
|
||||
content-types and body.
|
||||
@@ -406,6 +424,9 @@ class UsageApi(object):
|
||||
kwargs['_check_return_type'] = kwargs.get(
|
||||
'_check_return_type', True
|
||||
)
|
||||
kwargs['_spec_property_naming'] = kwargs.get(
|
||||
'_spec_property_naming', False
|
||||
)
|
||||
kwargs['_content_type'] = kwargs.get(
|
||||
'_content_type')
|
||||
kwargs['_host_index'] = kwargs.get('_host_index')
|
||||
@@ -441,6 +462,10 @@ class UsageApi(object):
|
||||
_check_return_type (bool): specifies if type checking
|
||||
should be done one the data received from the server.
|
||||
Default is True.
|
||||
_spec_property_naming (bool): True if the variable names in the input data
|
||||
are serialized names, as specified in the OpenAPI document.
|
||||
False if the variable names in the input data
|
||||
are pythonic names, e.g. snake case (default)
|
||||
_content_type (str/None): force body content-type.
|
||||
Default is None and content-type will be predicted by allowed
|
||||
content-types and body.
|
||||
@@ -472,6 +497,9 @@ class UsageApi(object):
|
||||
kwargs['_check_return_type'] = kwargs.get(
|
||||
'_check_return_type', True
|
||||
)
|
||||
kwargs['_spec_property_naming'] = kwargs.get(
|
||||
'_spec_property_naming', False
|
||||
)
|
||||
kwargs['_content_type'] = kwargs.get(
|
||||
'_content_type')
|
||||
kwargs['_host_index'] = kwargs.get('_host_index')
|
||||
|
||||
@@ -673,7 +673,8 @@ class Endpoint(object):
|
||||
'_return_http_data_only',
|
||||
'_check_input_type',
|
||||
'_check_return_type',
|
||||
'_content_type'
|
||||
'_content_type',
|
||||
'_spec_property_naming'
|
||||
])
|
||||
self.params_map['nullable'].extend(['_request_timeout'])
|
||||
self.validations = root_map['validations']
|
||||
@@ -687,6 +688,7 @@ class Endpoint(object):
|
||||
'_return_http_data_only': (bool,),
|
||||
'_check_input_type': (bool,),
|
||||
'_check_return_type': (bool,),
|
||||
'_spec_property_naming': (bool,),
|
||||
'_content_type': (none_type, str)
|
||||
}
|
||||
self.openapi_types.update(extra_types)
|
||||
@@ -723,7 +725,7 @@ class Endpoint(object):
|
||||
value,
|
||||
self.openapi_types[key],
|
||||
[key],
|
||||
False,
|
||||
kwargs['_spec_property_naming'],
|
||||
kwargs['_check_input_type'],
|
||||
configuration=self.api_client.configuration
|
||||
)
|
||||
@@ -751,11 +753,11 @@ class Endpoint(object):
|
||||
base_name = self.attribute_map[param_name]
|
||||
if (param_location == 'form' and
|
||||
self.openapi_types[param_name] == (file_type,)):
|
||||
params['file'][param_name] = [param_value]
|
||||
params['file'][base_name] = [param_value]
|
||||
elif (param_location == 'form' and
|
||||
self.openapi_types[param_name] == ([file_type],)):
|
||||
# param_value is already a list
|
||||
params['file'][param_name] = param_value
|
||||
params['file'][base_name] = param_value
|
||||
elif param_location in {'form', 'query'}:
|
||||
param_value_full = (base_name, param_value)
|
||||
params[param_location].append(param_value_full)
|
||||
|
||||
@@ -1657,6 +1657,7 @@ def model_to_dict(model_instance, serialize=True):
|
||||
attribute_map
|
||||
"""
|
||||
result = {}
|
||||
extract_item = lambda item: (item[0], model_to_dict(item[1], serialize=serialize)) if hasattr(item[1], '_data_store') else item
|
||||
|
||||
model_instances = [model_instance]
|
||||
if model_instance._composed_schemas:
|
||||
@@ -1686,14 +1687,17 @@ def model_to_dict(model_instance, serialize=True):
|
||||
res.append(v)
|
||||
elif isinstance(v, ModelSimple):
|
||||
res.append(v.value)
|
||||
elif isinstance(v, dict):
|
||||
res.append(dict(map(
|
||||
extract_item,
|
||||
v.items()
|
||||
)))
|
||||
else:
|
||||
res.append(model_to_dict(v, serialize=serialize))
|
||||
result[attr] = res
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0],
|
||||
model_to_dict(item[1], serialize=serialize))
|
||||
if hasattr(item[1], '_data_store') else item,
|
||||
extract_item,
|
||||
value.items()
|
||||
))
|
||||
elif isinstance(value, ModelSimple):
|
||||
|
||||
Reference in New Issue
Block a user