Merge remote-tracking branch 'origin/master' into 2.3.0

This commit is contained in:
wing328
2017-05-26 17:35:36 +08:00
66 changed files with 546 additions and 178 deletions

View File

@@ -14,7 +14,7 @@ To test code injection */ ' \" =end -- \\r\\n \\n \\r
### Example
```python
from __future__ import print_statement
from __future__ import print_function
import time
import petstore_api
from petstore_api.rest import ApiException

View File

@@ -610,16 +610,17 @@ class ApiClient(object):
:param klass: class literal.
:return: model object.
"""
instance = klass()
if not instance.swagger_types:
if not klass.swagger_types:
return data
for attr, attr_type in iteritems(instance.swagger_types):
kwargs = {}
for attr, attr_type in iteritems(klass.swagger_types):
if data is not None \
and instance.attribute_map[attr] in data \
and klass.attribute_map[attr] in data \
and isinstance(data, (list, dict)):
value = data[instance.attribute_map[attr]]
setattr(instance, attr, self.__deserialize(value, attr_type))
value = data[klass.attribute_map[attr]]
kwargs[attr] = self.__deserialize(value, attr_type)
instance = klass(**kwargs)
return instance

View File

@@ -21,28 +21,30 @@ class ModelReturn(object):
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'_return': 'int'
}
attribute_map = {
'_return': 'return'
}
def __init__(self, _return=None):
"""
ModelReturn - a model defined in Swagger
:param dict swaggerTypes: The key is attribute name
and the value is attribute type.
:param dict attributeMap: The key is attribute name
and the value is json key in definition.
"""
self.swagger_types = {
'_return': 'int'
}
self.attribute_map = {
'_return': 'return'
}
self.__return = None
# TODO: let required properties as mandatory parameter in the constructor.
# - to check if required property is not None (e.g. by calling setter)
# - ApiClient.__deserialize_model has to be adapted as well
if _return is not None:
self._return = _return