set 'None' to body for request if given body is 'None' ( issue #3020 ) (#3021)

This commit is contained in:
Takuro Wada
2016-06-02 15:51:13 +09:00
committed by wing328
parent 23d2c56096
commit 91c35509b8
10 changed files with 180 additions and 16 deletions

View File

@@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.

View File

@@ -5,7 +5,7 @@ This Python package is automatically generated by the [Swagger Codegen](https://
- API version: 1.0.0
- Package version: 1.0.0
- Build date: 2016-05-26T21:44:18.823+01:00
- Build date: 2016-06-02T12:44:41.178+09:00
- Build package: class io.swagger.codegen.languages.PythonClientCodegen
## Requirements.
@@ -130,12 +130,6 @@ Class | Method | HTTP request | Description
## Documentation For Authorization
## api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
## petstore_auth
- **Type**: OAuth
@@ -145,6 +139,12 @@ Class | Method | HTTP request | Description
- **write:pets**: modify pets in your account
- **read:pets**: read your pets
## api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
## Author

View File

@@ -3,6 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**map_property** | **dict(str, str)** | | [optional]
**map_of_map_property** | [**dict(str, dict(str, str))**](dict.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -3,6 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**array_of_string** | **list[str]** | | [optional]
**array_array_of_integer** | **list[list[int]]** | | [optional]
**array_array_of_model** | **list[list[ReadOnlyFirst]]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **str** | | [optional]
**date_time** | **datetime** | | [optional]
**map** | [**dict(str, Animal)**](Animal.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -42,13 +42,63 @@ class AdditionalPropertiesClass(object):
and the value is json key in definition.
"""
self.swagger_types = {
'map_property': 'dict(str, str)',
'map_of_map_property': 'dict(str, dict(str, str))'
}
self.attribute_map = {
'map_property': 'map_property',
'map_of_map_property': 'map_of_map_property'
}
self._map_property = None
self._map_of_map_property = None
@property
def map_property(self):
"""
Gets the map_property of this AdditionalPropertiesClass.
:return: The map_property of this AdditionalPropertiesClass.
:rtype: dict(str, str)
"""
return self._map_property
@map_property.setter
def map_property(self, map_property):
"""
Sets the map_property of this AdditionalPropertiesClass.
:param map_property: The map_property of this AdditionalPropertiesClass.
:type: dict(str, str)
"""
self._map_property = map_property
@property
def map_of_map_property(self):
"""
Gets the map_of_map_property of this AdditionalPropertiesClass.
:return: The map_of_map_property of this AdditionalPropertiesClass.
:rtype: dict(str, dict(str, str))
"""
return self._map_of_map_property
@map_of_map_property.setter
def map_of_map_property(self, map_of_map_property):
"""
Sets the map_of_map_property of this AdditionalPropertiesClass.
:param map_of_map_property: The map_of_map_property of this AdditionalPropertiesClass.
:type: dict(str, dict(str, str))
"""
self._map_of_map_property = map_of_map_property
def to_dict(self):
"""

View File

@@ -42,13 +42,89 @@ class ArrayTest(object):
and the value is json key in definition.
"""
self.swagger_types = {
'array_of_string': 'list[str]',
'array_array_of_integer': 'list[list[int]]',
'array_array_of_model': 'list[list[ReadOnlyFirst]]'
}
self.attribute_map = {
'array_of_string': 'array_of_string',
'array_array_of_integer': 'array_array_of_integer',
'array_array_of_model': 'array_array_of_model'
}
self._array_of_string = None
self._array_array_of_integer = None
self._array_array_of_model = None
@property
def array_of_string(self):
"""
Gets the array_of_string of this ArrayTest.
:return: The array_of_string of this ArrayTest.
:rtype: list[str]
"""
return self._array_of_string
@array_of_string.setter
def array_of_string(self, array_of_string):
"""
Sets the array_of_string of this ArrayTest.
:param array_of_string: The array_of_string of this ArrayTest.
:type: list[str]
"""
self._array_of_string = array_of_string
@property
def array_array_of_integer(self):
"""
Gets the array_array_of_integer of this ArrayTest.
:return: The array_array_of_integer of this ArrayTest.
:rtype: list[list[int]]
"""
return self._array_array_of_integer
@array_array_of_integer.setter
def array_array_of_integer(self, array_array_of_integer):
"""
Sets the array_array_of_integer of this ArrayTest.
:param array_array_of_integer: The array_array_of_integer of this ArrayTest.
:type: list[list[int]]
"""
self._array_array_of_integer = array_array_of_integer
@property
def array_array_of_model(self):
"""
Gets the array_array_of_model of this ArrayTest.
:return: The array_array_of_model of this ArrayTest.
:rtype: list[list[ReadOnlyFirst]]
"""
return self._array_array_of_model
@array_array_of_model.setter
def array_array_of_model(self, array_array_of_model):
"""
Sets the array_array_of_model of this ArrayTest.
:param array_array_of_model: The array_array_of_model of this ArrayTest.
:type: list[list[ReadOnlyFirst]]
"""
self._array_array_of_model = array_array_of_model
def to_dict(self):
"""

View File

@@ -43,16 +43,19 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
"""
self.swagger_types = {
'uuid': 'str',
'date_time': 'datetime'
'date_time': 'datetime',
'map': 'dict(str, Animal)'
}
self.attribute_map = {
'uuid': 'uuid',
'date_time': 'dateTime'
'date_time': 'dateTime',
'map': 'map'
}
self._uuid = None
self._date_time = None
self._map = None
@property
def uuid(self):
@@ -100,6 +103,29 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
self._date_time = date_time
@property
def map(self):
"""
Gets the map of this MixedPropertiesAndAdditionalPropertiesClass.
:return: The map of this MixedPropertiesAndAdditionalPropertiesClass.
:rtype: dict(str, Animal)
"""
return self._map
@map.setter
def map(self, map):
"""
Sets the map of this MixedPropertiesAndAdditionalPropertiesClass.
:param map: The map of this MixedPropertiesAndAdditionalPropertiesClass.
:type: dict(str, Animal)
"""
self._map = map
def to_dict(self):
"""
Returns the model properties as a dict

View File

@@ -142,8 +142,11 @@ class RESTClientObject(object):
if query_params:
url += '?' + urlencode(query_params)
if headers['Content-Type'] == 'application/json':
request_body = None
if body:
request_body = json.dumps(body)
r = self.pool_manager.request(method, url,
body=json.dumps(body),
body=request_body,
headers=headers)
if headers['Content-Type'] == 'application/x-www-form-urlencoded':
r = self.pool_manager.request(method, url,