diff --git a/modules/swagger-codegen/src/main/resources/python/rest.mustache b/modules/swagger-codegen/src/main/resources/python/rest.mustache index e09090a979..1a6cf193b6 100644 --- a/modules/swagger-codegen/src/main/resources/python/rest.mustache +++ b/modules/swagger-codegen/src/main/resources/python/rest.mustache @@ -122,8 +122,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, diff --git a/samples/client/petstore/python/LICENSE b/samples/client/petstore/python/LICENSE index 9c8f3ea087..8dada3edaf 100644 --- a/samples/client/petstore/python/LICENSE +++ b/samples/client/petstore/python/LICENSE @@ -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. \ No newline at end of file + limitations under the License. diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md index 1c037fa925..274de71c43 100644 --- a/samples/client/petstore/python/README.md +++ b/samples/client/petstore/python/README.md @@ -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 diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python/docs/AdditionalPropertiesClass.md index 420ac6efe6..ea12f270f0 100644 --- a/samples/client/petstore/python/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/python/docs/AdditionalPropertiesClass.md @@ -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) diff --git a/samples/client/petstore/python/docs/ArrayTest.md b/samples/client/petstore/python/docs/ArrayTest.md index 9dcc2c9726..6ab0d13780 100644 --- a/samples/client/petstore/python/docs/ArrayTest.md +++ b/samples/client/petstore/python/docs/ArrayTest.md @@ -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) diff --git a/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 1f8d83427a..b9808d5275 100644 --- a/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -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) diff --git a/samples/client/petstore/python/swagger_client/models/additional_properties_class.py b/samples/client/petstore/python/swagger_client/models/additional_properties_class.py index ed19d7536a..c62cc80cd8 100644 --- a/samples/client/petstore/python/swagger_client/models/additional_properties_class.py +++ b/samples/client/petstore/python/swagger_client/models/additional_properties_class.py @@ -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): """ diff --git a/samples/client/petstore/python/swagger_client/models/array_test.py b/samples/client/petstore/python/swagger_client/models/array_test.py index ab340f1d13..def23e7cd5 100644 --- a/samples/client/petstore/python/swagger_client/models/array_test.py +++ b/samples/client/petstore/python/swagger_client/models/array_test.py @@ -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): """ diff --git a/samples/client/petstore/python/swagger_client/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/swagger_client/models/mixed_properties_and_additional_properties_class.py index 90b9dcc7d7..2122cabdb5 100644 --- a/samples/client/petstore/python/swagger_client/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python/swagger_client/models/mixed_properties_and_additional_properties_class.py @@ -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 diff --git a/samples/client/petstore/python/swagger_client/rest.py b/samples/client/petstore/python/swagger_client/rest.py index 96c3b6dabc..de53bcacdb 100644 --- a/samples/client/petstore/python/swagger_client/rest.py +++ b/samples/client/petstore/python/swagger_client/rest.py @@ -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,