diff --git a/samples/client/petstore/python-asyncio/README.md b/samples/client/petstore/python-asyncio/README.md index a49d99c556cd..c0eeb4d7122a 100644 --- a/samples/client/petstore/python-asyncio/README.md +++ b/samples/client/petstore/python-asyncio/README.md @@ -74,6 +74,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | *FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | *FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters diff --git a/samples/client/petstore/python-asyncio/docs/EnumTest.md b/samples/client/petstore/python-asyncio/docs/EnumTest.md index 94dd48646294..0237002d1cd7 100644 --- a/samples/client/petstore/python-asyncio/docs/EnumTest.md +++ b/samples/client/petstore/python-asyncio/docs/EnumTest.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enum_string** | **str** | | [optional] +**enum_string_required** | **str** | | **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] **outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] diff --git a/samples/client/petstore/python-asyncio/docs/FakeApi.md b/samples/client/petstore/python-asyncio/docs/FakeApi.md index 1da84500bfef..91b30efd5166 100644 --- a/samples/client/petstore/python-asyncio/docs/FakeApi.md +++ b/samples/client/petstore/python-asyncio/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | [**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters @@ -203,6 +204,52 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **test_body_with_query_params** +> test_body_with_query_params(body, query) + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.User() # User | +query = 'query_example' # str | + +try: + api_instance.test_body_with_query_params(body, query) +except ApiException as e: + print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| | + **query** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **test_client_model** > Client test_client_model(body) @@ -252,7 +299,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_endpoint_parameters** -> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) +> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, _float=_float, string=string, binary=binary, _date=_date, date_time=date_time, password=password, param_callback=param_callback) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -280,17 +327,17 @@ byte = 'B' # str | None integer = 56 # int | None (optional) int32 = 56 # int | None (optional) int64 = 789 # int | None (optional) -float = 3.4 # float | None (optional) +_float = 3.4 # float | None (optional) string = 'string_example' # str | None (optional) binary = 'B' # str | None (optional) -date = '2013-10-20' # date | None (optional) +_date = '2013-10-20' # date | None (optional) date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) password = 'password_example' # str | None (optional) param_callback = 'param_callback_example' # str | None (optional) try: # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, _float=_float, string=string, binary=binary, _date=_date, date_time=date_time, password=password, param_callback=param_callback) except ApiException as e: print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) ``` @@ -306,10 +353,10 @@ Name | Type | Description | Notes **integer** | **int**| None | [optional] **int32** | **int**| None | [optional] **int64** | **int**| None | [optional] - **float** | **float**| None | [optional] + **_float** | **float**| None | [optional] **string** | **str**| None | [optional] **binary** | **str**| None | [optional] - **date** | **date**| None | [optional] + **_date** | **date**| None | [optional] **date_time** | **datetime**| None | [optional] **password** | **str**| None | [optional] **param_callback** | **str**| None | [optional] diff --git a/samples/client/petstore/python-asyncio/docs/FormatTest.md b/samples/client/petstore/python-asyncio/docs/FormatTest.md index 3e489e863fa0..eb8e6d91d6cc 100644 --- a/samples/client/petstore/python-asyncio/docs/FormatTest.md +++ b/samples/client/petstore/python-asyncio/docs/FormatTest.md @@ -7,12 +7,12 @@ Name | Type | Description | Notes **int32** | **int** | | [optional] **int64** | **int** | | [optional] **number** | **float** | | -**float** | **float** | | [optional] +**_float** | **float** | | [optional] **double** | **float** | | [optional] **string** | **str** | | [optional] **byte** | **str** | | **binary** | **str** | | [optional] -**date** | **date** | | +**_date** | **date** | | **date_time** | **datetime** | | [optional] **uuid** | **str** | | [optional] **password** | **str** | | diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py index 4c52ee51647d..e62868348862 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py @@ -381,6 +381,107 @@ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + def test_body_with_query_params(self, body, query, **kwargs): # noqa: E501 + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_body_with_query_params(body, query, async=True) + >>> result = thread.get() + + :param async bool + :param User body: (required) + :param str query: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_body_with_query_params_with_http_info(body, query, **kwargs) # noqa: E501 + else: + (data) = self.test_body_with_query_params_with_http_info(body, query, **kwargs) # noqa: E501 + return data + + def test_body_with_query_params_with_http_info(self, body, query, **kwargs): # noqa: E501 + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_body_with_query_params_with_http_info(body, query, async=True) + >>> result = thread.get() + + :param async bool + :param User body: (required) + :param str query: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'query'] # noqa: E501 + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_body_with_query_params" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_body_with_query_params`") # noqa: E501 + # verify the required parameter 'query' is set + if ('query' not in params or + params['query'] is None): + raise ValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'query' in params: + query_params.append(('query', params['query'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/body-with-query-params', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def test_client_model(self, body, **kwargs): # noqa: E501 """To test \"client\" model # noqa: E501 @@ -497,10 +598,10 @@ def test_endpoint_parameters(self, number, double, pattern_without_delimiter, by :param int integer: None :param int int32: None :param int int64: None - :param float float: None + :param float _float: None :param str string: None :param str binary: None - :param date date: None + :param date _date: None :param datetime date_time: None :param str password: None :param str param_callback: None @@ -532,10 +633,10 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou :param int integer: None :param int int32: None :param int int64: None - :param float float: None + :param float _float: None :param str string: None :param str binary: None - :param date date: None + :param date _date: None :param datetime date_time: None :param str password: None :param str param_callback: None @@ -544,7 +645,7 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou returns the request thread. """ - all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] # noqa: E501 + all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', '_float', 'string', 'binary', '_date', 'date_time', 'password', 'param_callback'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -594,8 +695,8 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501 if 'int32' in params and params['int32'] < 20: # noqa: E501 raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501 - if 'float' in params and params['float'] > 987.6: # noqa: E501 - raise ValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 + if '_float' in params and params['_float'] > 987.6: # noqa: E501 + raise ValueError("Invalid value for parameter `_float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 if 'string' in params and not re.search('[a-z]', params['string'], flags=re.IGNORECASE): # noqa: E501 raise ValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501 if ('password' in params and @@ -622,8 +723,8 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou form_params.append(('int64', params['int64'])) # noqa: E501 if 'number' in params: form_params.append(('number', params['number'])) # noqa: E501 - if 'float' in params: - form_params.append(('float', params['float'])) # noqa: E501 + if '_float' in params: + form_params.append(('float', params['_float'])) # noqa: E501 if 'double' in params: form_params.append(('double', params['double'])) # noqa: E501 if 'string' in params: @@ -634,8 +735,8 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou form_params.append(('byte', params['byte'])) # noqa: E501 if 'binary' in params: form_params.append(('binary', params['binary'])) # noqa: E501 - if 'date' in params: - form_params.append(('date', params['date'])) # noqa: E501 + if '_date' in params: + form_params.append(('date', params['_date'])) # noqa: E501 if 'date_time' in params: form_params.append(('dateTime', params['date_time'])) # noqa: E501 if 'password' in params: diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py index 0a362e400390..6bd415ded1bf 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -46,6 +46,8 @@ class ApiClient(object): the API. :param cookie: a cookie to include in the header when making calls to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. """ PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types @@ -59,14 +61,15 @@ class ApiClient(object): 'datetime': datetime.datetime, 'object': object, } + _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None): + cookie=None, pool_threads=1): if configuration is None: configuration = Configuration() self.configuration = configuration + self.pool_threads = pool_threads - self.pool = ThreadPool() self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} if header_name is not None: @@ -76,8 +79,20 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.user_agent = 'Swagger-Codegen/1.0.0/python' def __del__(self): - self.pool.close() - self.pool.join() + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + + @property + def pool(self): + """Create thread pool on first request + + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + self._pool = ThreadPool(self.pool_threads) + return self._pool @property def user_agent(self): diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py index 1bb234764abb..565975d725c8 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py @@ -34,6 +34,7 @@ class EnumTest(object): """ swagger_types = { 'enum_string': 'str', + 'enum_string_required': 'str', 'enum_integer': 'int', 'enum_number': 'float', 'outer_enum': 'OuterEnum' @@ -41,15 +42,17 @@ class EnumTest(object): attribute_map = { 'enum_string': 'enum_string', + 'enum_string_required': 'enum_string_required', 'enum_integer': 'enum_integer', 'enum_number': 'enum_number', 'outer_enum': 'outerEnum' } - def __init__(self, enum_string=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501 + def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501 """EnumTest - a model defined in Swagger""" # noqa: E501 self._enum_string = None + self._enum_string_required = None self._enum_integer = None self._enum_number = None self._outer_enum = None @@ -57,6 +60,7 @@ def __init__(self, enum_string=None, enum_integer=None, enum_number=None, outer_ if enum_string is not None: self.enum_string = enum_string + self.enum_string_required = enum_string_required if enum_integer is not None: self.enum_integer = enum_integer if enum_number is not None: @@ -91,6 +95,35 @@ def enum_string(self, enum_string): self._enum_string = enum_string + @property + def enum_string_required(self): + """Gets the enum_string_required of this EnumTest. # noqa: E501 + + + :return: The enum_string_required of this EnumTest. # noqa: E501 + :rtype: str + """ + return self._enum_string_required + + @enum_string_required.setter + def enum_string_required(self, enum_string_required): + """Sets the enum_string_required of this EnumTest. + + + :param enum_string_required: The enum_string_required of this EnumTest. # noqa: E501 + :type: str + """ + if enum_string_required is None: + raise ValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501 + allowed_values = ["UPPER", "lower", ""] # noqa: E501 + if enum_string_required not in allowed_values: + raise ValueError( + "Invalid value for `enum_string_required` ({0}), must be one of {1}" # noqa: E501 + .format(enum_string_required, allowed_values) + ) + + self._enum_string_required = enum_string_required + @property def enum_integer(self): """Gets the enum_integer of this EnumTest. # noqa: E501 diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/format_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/format_test.py index 7974d732fda9..467b4a2573d0 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/format_test.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/format_test.py @@ -35,12 +35,12 @@ class FormatTest(object): 'int32': 'int', 'int64': 'int', 'number': 'float', - 'float': 'float', + '_float': 'float', 'double': 'float', 'string': 'str', 'byte': 'str', 'binary': 'str', - 'date': 'date', + '_date': 'date', 'date_time': 'datetime', 'uuid': 'str', 'password': 'str' @@ -51,30 +51,30 @@ class FormatTest(object): 'int32': 'int32', 'int64': 'int64', 'number': 'number', - 'float': 'float', + '_float': 'float', 'double': 'double', 'string': 'string', 'byte': 'byte', 'binary': 'binary', - 'date': 'date', + '_date': 'date', 'date_time': 'dateTime', 'uuid': 'uuid', 'password': 'password' } - def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None): # noqa: E501 + def __init__(self, integer=None, int32=None, int64=None, number=None, _float=None, double=None, string=None, byte=None, binary=None, _date=None, date_time=None, uuid=None, password=None): # noqa: E501 """FormatTest - a model defined in Swagger""" # noqa: E501 self._integer = None self._int32 = None self._int64 = None self._number = None - self._float = None + self.__float = None self._double = None self._string = None self._byte = None self._binary = None - self._date = None + self.__date = None self._date_time = None self._uuid = None self._password = None @@ -87,8 +87,8 @@ def __init__(self, integer=None, int32=None, int64=None, number=None, float=None if int64 is not None: self.int64 = int64 self.number = number - if float is not None: - self.float = float + if _float is not None: + self._float = _float if double is not None: self.double = double if string is not None: @@ -96,7 +96,7 @@ def __init__(self, integer=None, int32=None, int64=None, number=None, float=None self.byte = byte if binary is not None: self.binary = binary - self.date = date + self._date = _date if date_time is not None: self.date_time = date_time if uuid is not None: @@ -202,29 +202,29 @@ def number(self, number): self._number = number @property - def float(self): - """Gets the float of this FormatTest. # noqa: E501 + def _float(self): + """Gets the _float of this FormatTest. # noqa: E501 - :return: The float of this FormatTest. # noqa: E501 + :return: The _float of this FormatTest. # noqa: E501 :rtype: float """ - return self._float + return self.__float - @float.setter - def float(self, float): - """Sets the float of this FormatTest. + @_float.setter + def _float(self, _float): + """Sets the _float of this FormatTest. - :param float: The float of this FormatTest. # noqa: E501 + :param _float: The _float of this FormatTest. # noqa: E501 :type: float """ - if float is not None and float > 987.6: # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501 - if float is not None and float < 54.3: # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") # noqa: E501 + if _float is not None and _float > 987.6: # noqa: E501 + raise ValueError("Invalid value for `_float`, must be a value less than or equal to `987.6`") # noqa: E501 + if _float is not None and _float < 54.3: # noqa: E501 + raise ValueError("Invalid value for `_float`, must be a value greater than or equal to `54.3`") # noqa: E501 - self._float = float + self.__float = _float @property def double(self): @@ -321,27 +321,27 @@ def binary(self, binary): self._binary = binary @property - def date(self): - """Gets the date of this FormatTest. # noqa: E501 + def _date(self): + """Gets the _date of this FormatTest. # noqa: E501 - :return: The date of this FormatTest. # noqa: E501 + :return: The _date of this FormatTest. # noqa: E501 :rtype: date """ - return self._date + return self.__date - @date.setter - def date(self, date): - """Sets the date of this FormatTest. + @_date.setter + def _date(self, _date): + """Sets the _date of this FormatTest. - :param date: The date of this FormatTest. # noqa: E501 + :param _date: The _date of this FormatTest. # noqa: E501 :type: date """ - if date is None: - raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 + if _date is None: + raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 - self._date = date + self.__date = _date @property def date_time(self): diff --git a/samples/client/petstore/python-tornado/README.md b/samples/client/petstore/python-tornado/README.md index a49d99c556cd..c0eeb4d7122a 100644 --- a/samples/client/petstore/python-tornado/README.md +++ b/samples/client/petstore/python-tornado/README.md @@ -74,6 +74,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | *FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | *FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters diff --git a/samples/client/petstore/python-tornado/docs/EnumTest.md b/samples/client/petstore/python-tornado/docs/EnumTest.md index 94dd48646294..0237002d1cd7 100644 --- a/samples/client/petstore/python-tornado/docs/EnumTest.md +++ b/samples/client/petstore/python-tornado/docs/EnumTest.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enum_string** | **str** | | [optional] +**enum_string_required** | **str** | | **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] **outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] diff --git a/samples/client/petstore/python-tornado/docs/FakeApi.md b/samples/client/petstore/python-tornado/docs/FakeApi.md index 1da84500bfef..91b30efd5166 100644 --- a/samples/client/petstore/python-tornado/docs/FakeApi.md +++ b/samples/client/petstore/python-tornado/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | [**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters @@ -203,6 +204,52 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **test_body_with_query_params** +> test_body_with_query_params(body, query) + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.User() # User | +query = 'query_example' # str | + +try: + api_instance.test_body_with_query_params(body, query) +except ApiException as e: + print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| | + **query** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **test_client_model** > Client test_client_model(body) @@ -252,7 +299,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_endpoint_parameters** -> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) +> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, _float=_float, string=string, binary=binary, _date=_date, date_time=date_time, password=password, param_callback=param_callback) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -280,17 +327,17 @@ byte = 'B' # str | None integer = 56 # int | None (optional) int32 = 56 # int | None (optional) int64 = 789 # int | None (optional) -float = 3.4 # float | None (optional) +_float = 3.4 # float | None (optional) string = 'string_example' # str | None (optional) binary = 'B' # str | None (optional) -date = '2013-10-20' # date | None (optional) +_date = '2013-10-20' # date | None (optional) date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) password = 'password_example' # str | None (optional) param_callback = 'param_callback_example' # str | None (optional) try: # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, _float=_float, string=string, binary=binary, _date=_date, date_time=date_time, password=password, param_callback=param_callback) except ApiException as e: print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) ``` @@ -306,10 +353,10 @@ Name | Type | Description | Notes **integer** | **int**| None | [optional] **int32** | **int**| None | [optional] **int64** | **int**| None | [optional] - **float** | **float**| None | [optional] + **_float** | **float**| None | [optional] **string** | **str**| None | [optional] **binary** | **str**| None | [optional] - **date** | **date**| None | [optional] + **_date** | **date**| None | [optional] **date_time** | **datetime**| None | [optional] **password** | **str**| None | [optional] **param_callback** | **str**| None | [optional] diff --git a/samples/client/petstore/python-tornado/docs/FormatTest.md b/samples/client/petstore/python-tornado/docs/FormatTest.md index 3e489e863fa0..eb8e6d91d6cc 100644 --- a/samples/client/petstore/python-tornado/docs/FormatTest.md +++ b/samples/client/petstore/python-tornado/docs/FormatTest.md @@ -7,12 +7,12 @@ Name | Type | Description | Notes **int32** | **int** | | [optional] **int64** | **int** | | [optional] **number** | **float** | | -**float** | **float** | | [optional] +**_float** | **float** | | [optional] **double** | **float** | | [optional] **string** | **str** | | [optional] **byte** | **str** | | **binary** | **str** | | [optional] -**date** | **date** | | +**_date** | **date** | | **date_time** | **datetime** | | [optional] **uuid** | **str** | | [optional] **password** | **str** | | diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py index 4c52ee51647d..e62868348862 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py @@ -381,6 +381,107 @@ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + def test_body_with_query_params(self, body, query, **kwargs): # noqa: E501 + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_body_with_query_params(body, query, async=True) + >>> result = thread.get() + + :param async bool + :param User body: (required) + :param str query: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_body_with_query_params_with_http_info(body, query, **kwargs) # noqa: E501 + else: + (data) = self.test_body_with_query_params_with_http_info(body, query, **kwargs) # noqa: E501 + return data + + def test_body_with_query_params_with_http_info(self, body, query, **kwargs): # noqa: E501 + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_body_with_query_params_with_http_info(body, query, async=True) + >>> result = thread.get() + + :param async bool + :param User body: (required) + :param str query: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'query'] # noqa: E501 + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_body_with_query_params" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_body_with_query_params`") # noqa: E501 + # verify the required parameter 'query' is set + if ('query' not in params or + params['query'] is None): + raise ValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'query' in params: + query_params.append(('query', params['query'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/body-with-query-params', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def test_client_model(self, body, **kwargs): # noqa: E501 """To test \"client\" model # noqa: E501 @@ -497,10 +598,10 @@ def test_endpoint_parameters(self, number, double, pattern_without_delimiter, by :param int integer: None :param int int32: None :param int int64: None - :param float float: None + :param float _float: None :param str string: None :param str binary: None - :param date date: None + :param date _date: None :param datetime date_time: None :param str password: None :param str param_callback: None @@ -532,10 +633,10 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou :param int integer: None :param int int32: None :param int int64: None - :param float float: None + :param float _float: None :param str string: None :param str binary: None - :param date date: None + :param date _date: None :param datetime date_time: None :param str password: None :param str param_callback: None @@ -544,7 +645,7 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou returns the request thread. """ - all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] # noqa: E501 + all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', '_float', 'string', 'binary', '_date', 'date_time', 'password', 'param_callback'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -594,8 +695,8 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501 if 'int32' in params and params['int32'] < 20: # noqa: E501 raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501 - if 'float' in params and params['float'] > 987.6: # noqa: E501 - raise ValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 + if '_float' in params and params['_float'] > 987.6: # noqa: E501 + raise ValueError("Invalid value for parameter `_float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 if 'string' in params and not re.search('[a-z]', params['string'], flags=re.IGNORECASE): # noqa: E501 raise ValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501 if ('password' in params and @@ -622,8 +723,8 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou form_params.append(('int64', params['int64'])) # noqa: E501 if 'number' in params: form_params.append(('number', params['number'])) # noqa: E501 - if 'float' in params: - form_params.append(('float', params['float'])) # noqa: E501 + if '_float' in params: + form_params.append(('float', params['_float'])) # noqa: E501 if 'double' in params: form_params.append(('double', params['double'])) # noqa: E501 if 'string' in params: @@ -634,8 +735,8 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou form_params.append(('byte', params['byte'])) # noqa: E501 if 'binary' in params: form_params.append(('binary', params['binary'])) # noqa: E501 - if 'date' in params: - form_params.append(('date', params['date'])) # noqa: E501 + if '_date' in params: + form_params.append(('date', params['_date'])) # noqa: E501 if 'date_time' in params: form_params.append(('dateTime', params['date_time'])) # noqa: E501 if 'password' in params: diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py index 52d5e8aa0817..140acd96ff83 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -47,6 +47,8 @@ class ApiClient(object): the API. :param cookie: a cookie to include in the header when making calls to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. """ PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types @@ -60,14 +62,15 @@ class ApiClient(object): 'datetime': datetime.datetime, 'object': object, } + _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None): + cookie=None, pool_threads=1): if configuration is None: configuration = Configuration() self.configuration = configuration + self.pool_threads = pool_threads - self.pool = ThreadPool() self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} if header_name is not None: @@ -77,8 +80,20 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.user_agent = 'Swagger-Codegen/1.0.0/python' def __del__(self): - self.pool.close() - self.pool.join() + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + + @property + def pool(self): + """Create thread pool on first request + + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + self._pool = ThreadPool(self.pool_threads) + return self._pool @property def user_agent(self): diff --git a/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py b/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py index 1bb234764abb..565975d725c8 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py @@ -34,6 +34,7 @@ class EnumTest(object): """ swagger_types = { 'enum_string': 'str', + 'enum_string_required': 'str', 'enum_integer': 'int', 'enum_number': 'float', 'outer_enum': 'OuterEnum' @@ -41,15 +42,17 @@ class EnumTest(object): attribute_map = { 'enum_string': 'enum_string', + 'enum_string_required': 'enum_string_required', 'enum_integer': 'enum_integer', 'enum_number': 'enum_number', 'outer_enum': 'outerEnum' } - def __init__(self, enum_string=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501 + def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501 """EnumTest - a model defined in Swagger""" # noqa: E501 self._enum_string = None + self._enum_string_required = None self._enum_integer = None self._enum_number = None self._outer_enum = None @@ -57,6 +60,7 @@ def __init__(self, enum_string=None, enum_integer=None, enum_number=None, outer_ if enum_string is not None: self.enum_string = enum_string + self.enum_string_required = enum_string_required if enum_integer is not None: self.enum_integer = enum_integer if enum_number is not None: @@ -91,6 +95,35 @@ def enum_string(self, enum_string): self._enum_string = enum_string + @property + def enum_string_required(self): + """Gets the enum_string_required of this EnumTest. # noqa: E501 + + + :return: The enum_string_required of this EnumTest. # noqa: E501 + :rtype: str + """ + return self._enum_string_required + + @enum_string_required.setter + def enum_string_required(self, enum_string_required): + """Sets the enum_string_required of this EnumTest. + + + :param enum_string_required: The enum_string_required of this EnumTest. # noqa: E501 + :type: str + """ + if enum_string_required is None: + raise ValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501 + allowed_values = ["UPPER", "lower", ""] # noqa: E501 + if enum_string_required not in allowed_values: + raise ValueError( + "Invalid value for `enum_string_required` ({0}), must be one of {1}" # noqa: E501 + .format(enum_string_required, allowed_values) + ) + + self._enum_string_required = enum_string_required + @property def enum_integer(self): """Gets the enum_integer of this EnumTest. # noqa: E501 diff --git a/samples/client/petstore/python-tornado/petstore_api/models/format_test.py b/samples/client/petstore/python-tornado/petstore_api/models/format_test.py index 7974d732fda9..467b4a2573d0 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/format_test.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/format_test.py @@ -35,12 +35,12 @@ class FormatTest(object): 'int32': 'int', 'int64': 'int', 'number': 'float', - 'float': 'float', + '_float': 'float', 'double': 'float', 'string': 'str', 'byte': 'str', 'binary': 'str', - 'date': 'date', + '_date': 'date', 'date_time': 'datetime', 'uuid': 'str', 'password': 'str' @@ -51,30 +51,30 @@ class FormatTest(object): 'int32': 'int32', 'int64': 'int64', 'number': 'number', - 'float': 'float', + '_float': 'float', 'double': 'double', 'string': 'string', 'byte': 'byte', 'binary': 'binary', - 'date': 'date', + '_date': 'date', 'date_time': 'dateTime', 'uuid': 'uuid', 'password': 'password' } - def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None): # noqa: E501 + def __init__(self, integer=None, int32=None, int64=None, number=None, _float=None, double=None, string=None, byte=None, binary=None, _date=None, date_time=None, uuid=None, password=None): # noqa: E501 """FormatTest - a model defined in Swagger""" # noqa: E501 self._integer = None self._int32 = None self._int64 = None self._number = None - self._float = None + self.__float = None self._double = None self._string = None self._byte = None self._binary = None - self._date = None + self.__date = None self._date_time = None self._uuid = None self._password = None @@ -87,8 +87,8 @@ def __init__(self, integer=None, int32=None, int64=None, number=None, float=None if int64 is not None: self.int64 = int64 self.number = number - if float is not None: - self.float = float + if _float is not None: + self._float = _float if double is not None: self.double = double if string is not None: @@ -96,7 +96,7 @@ def __init__(self, integer=None, int32=None, int64=None, number=None, float=None self.byte = byte if binary is not None: self.binary = binary - self.date = date + self._date = _date if date_time is not None: self.date_time = date_time if uuid is not None: @@ -202,29 +202,29 @@ def number(self, number): self._number = number @property - def float(self): - """Gets the float of this FormatTest. # noqa: E501 + def _float(self): + """Gets the _float of this FormatTest. # noqa: E501 - :return: The float of this FormatTest. # noqa: E501 + :return: The _float of this FormatTest. # noqa: E501 :rtype: float """ - return self._float + return self.__float - @float.setter - def float(self, float): - """Sets the float of this FormatTest. + @_float.setter + def _float(self, _float): + """Sets the _float of this FormatTest. - :param float: The float of this FormatTest. # noqa: E501 + :param _float: The _float of this FormatTest. # noqa: E501 :type: float """ - if float is not None and float > 987.6: # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501 - if float is not None and float < 54.3: # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") # noqa: E501 + if _float is not None and _float > 987.6: # noqa: E501 + raise ValueError("Invalid value for `_float`, must be a value less than or equal to `987.6`") # noqa: E501 + if _float is not None and _float < 54.3: # noqa: E501 + raise ValueError("Invalid value for `_float`, must be a value greater than or equal to `54.3`") # noqa: E501 - self._float = float + self.__float = _float @property def double(self): @@ -321,27 +321,27 @@ def binary(self, binary): self._binary = binary @property - def date(self): - """Gets the date of this FormatTest. # noqa: E501 + def _date(self): + """Gets the _date of this FormatTest. # noqa: E501 - :return: The date of this FormatTest. # noqa: E501 + :return: The _date of this FormatTest. # noqa: E501 :rtype: date """ - return self._date + return self.__date - @date.setter - def date(self, date): - """Sets the date of this FormatTest. + @_date.setter + def _date(self, _date): + """Sets the _date of this FormatTest. - :param date: The date of this FormatTest. # noqa: E501 + :param _date: The _date of this FormatTest. # noqa: E501 :type: date """ - if date is None: - raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 + if _date is None: + raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 - self._date = date + self.__date = _date @property def date_time(self): diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md index a49d99c556cd..c0eeb4d7122a 100644 --- a/samples/client/petstore/python/README.md +++ b/samples/client/petstore/python/README.md @@ -74,6 +74,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | *FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | *FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters diff --git a/samples/client/petstore/python/docs/EnumTest.md b/samples/client/petstore/python/docs/EnumTest.md index 94dd48646294..0237002d1cd7 100644 --- a/samples/client/petstore/python/docs/EnumTest.md +++ b/samples/client/petstore/python/docs/EnumTest.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enum_string** | **str** | | [optional] +**enum_string_required** | **str** | | **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] **outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python/docs/FakeApi.md index 1da84500bfef..91b30efd5166 100644 --- a/samples/client/petstore/python/docs/FakeApi.md +++ b/samples/client/petstore/python/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | [**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters @@ -203,6 +204,52 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **test_body_with_query_params** +> test_body_with_query_params(body, query) + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.User() # User | +query = 'query_example' # str | + +try: + api_instance.test_body_with_query_params(body, query) +except ApiException as e: + print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| | + **query** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **test_client_model** > Client test_client_model(body) @@ -252,7 +299,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_endpoint_parameters** -> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) +> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, _float=_float, string=string, binary=binary, _date=_date, date_time=date_time, password=password, param_callback=param_callback) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -280,17 +327,17 @@ byte = 'B' # str | None integer = 56 # int | None (optional) int32 = 56 # int | None (optional) int64 = 789 # int | None (optional) -float = 3.4 # float | None (optional) +_float = 3.4 # float | None (optional) string = 'string_example' # str | None (optional) binary = 'B' # str | None (optional) -date = '2013-10-20' # date | None (optional) +_date = '2013-10-20' # date | None (optional) date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) password = 'password_example' # str | None (optional) param_callback = 'param_callback_example' # str | None (optional) try: # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, _float=_float, string=string, binary=binary, _date=_date, date_time=date_time, password=password, param_callback=param_callback) except ApiException as e: print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) ``` @@ -306,10 +353,10 @@ Name | Type | Description | Notes **integer** | **int**| None | [optional] **int32** | **int**| None | [optional] **int64** | **int**| None | [optional] - **float** | **float**| None | [optional] + **_float** | **float**| None | [optional] **string** | **str**| None | [optional] **binary** | **str**| None | [optional] - **date** | **date**| None | [optional] + **_date** | **date**| None | [optional] **date_time** | **datetime**| None | [optional] **password** | **str**| None | [optional] **param_callback** | **str**| None | [optional] diff --git a/samples/client/petstore/python/docs/FormatTest.md b/samples/client/petstore/python/docs/FormatTest.md index 3e489e863fa0..eb8e6d91d6cc 100644 --- a/samples/client/petstore/python/docs/FormatTest.md +++ b/samples/client/petstore/python/docs/FormatTest.md @@ -7,12 +7,12 @@ Name | Type | Description | Notes **int32** | **int** | | [optional] **int64** | **int** | | [optional] **number** | **float** | | -**float** | **float** | | [optional] +**_float** | **float** | | [optional] **double** | **float** | | [optional] **string** | **str** | | [optional] **byte** | **str** | | **binary** | **str** | | [optional] -**date** | **date** | | +**_date** | **date** | | **date_time** | **datetime** | | [optional] **uuid** | **str** | | [optional] **password** | **str** | | diff --git a/samples/client/petstore/python/petstore_api/api/fake_api.py b/samples/client/petstore/python/petstore_api/api/fake_api.py index 4c52ee51647d..e62868348862 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -381,6 +381,107 @@ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + def test_body_with_query_params(self, body, query, **kwargs): # noqa: E501 + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_body_with_query_params(body, query, async=True) + >>> result = thread.get() + + :param async bool + :param User body: (required) + :param str query: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_body_with_query_params_with_http_info(body, query, **kwargs) # noqa: E501 + else: + (data) = self.test_body_with_query_params_with_http_info(body, query, **kwargs) # noqa: E501 + return data + + def test_body_with_query_params_with_http_info(self, body, query, **kwargs): # noqa: E501 + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_body_with_query_params_with_http_info(body, query, async=True) + >>> result = thread.get() + + :param async bool + :param User body: (required) + :param str query: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'query'] # noqa: E501 + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_body_with_query_params" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_body_with_query_params`") # noqa: E501 + # verify the required parameter 'query' is set + if ('query' not in params or + params['query'] is None): + raise ValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'query' in params: + query_params.append(('query', params['query'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/body-with-query-params', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def test_client_model(self, body, **kwargs): # noqa: E501 """To test \"client\" model # noqa: E501 @@ -497,10 +598,10 @@ def test_endpoint_parameters(self, number, double, pattern_without_delimiter, by :param int integer: None :param int int32: None :param int int64: None - :param float float: None + :param float _float: None :param str string: None :param str binary: None - :param date date: None + :param date _date: None :param datetime date_time: None :param str password: None :param str param_callback: None @@ -532,10 +633,10 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou :param int integer: None :param int int32: None :param int int64: None - :param float float: None + :param float _float: None :param str string: None :param str binary: None - :param date date: None + :param date _date: None :param datetime date_time: None :param str password: None :param str param_callback: None @@ -544,7 +645,7 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou returns the request thread. """ - all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] # noqa: E501 + all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', '_float', 'string', 'binary', '_date', 'date_time', 'password', 'param_callback'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -594,8 +695,8 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501 if 'int32' in params and params['int32'] < 20: # noqa: E501 raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501 - if 'float' in params and params['float'] > 987.6: # noqa: E501 - raise ValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 + if '_float' in params and params['_float'] > 987.6: # noqa: E501 + raise ValueError("Invalid value for parameter `_float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 if 'string' in params and not re.search('[a-z]', params['string'], flags=re.IGNORECASE): # noqa: E501 raise ValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501 if ('password' in params and @@ -622,8 +723,8 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou form_params.append(('int64', params['int64'])) # noqa: E501 if 'number' in params: form_params.append(('number', params['number'])) # noqa: E501 - if 'float' in params: - form_params.append(('float', params['float'])) # noqa: E501 + if '_float' in params: + form_params.append(('float', params['_float'])) # noqa: E501 if 'double' in params: form_params.append(('double', params['double'])) # noqa: E501 if 'string' in params: @@ -634,8 +735,8 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou form_params.append(('byte', params['byte'])) # noqa: E501 if 'binary' in params: form_params.append(('binary', params['binary'])) # noqa: E501 - if 'date' in params: - form_params.append(('date', params['date'])) # noqa: E501 + if '_date' in params: + form_params.append(('date', params['_date'])) # noqa: E501 if 'date_time' in params: form_params.append(('dateTime', params['date_time'])) # noqa: E501 if 'password' in params: diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 28f65e75fcfc..76b88bf2baff 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -46,6 +46,8 @@ class ApiClient(object): the API. :param cookie: a cookie to include in the header when making calls to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. """ PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types @@ -59,14 +61,15 @@ class ApiClient(object): 'datetime': datetime.datetime, 'object': object, } + _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None): + cookie=None, pool_threads=1): if configuration is None: configuration = Configuration() self.configuration = configuration + self.pool_threads = pool_threads - self.pool = ThreadPool() self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} if header_name is not None: @@ -76,8 +79,20 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.user_agent = 'Swagger-Codegen/1.0.0/python' def __del__(self): - self.pool.close() - self.pool.join() + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + + @property + def pool(self): + """Create thread pool on first request + + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + self._pool = ThreadPool(self.pool_threads) + return self._pool @property def user_agent(self): diff --git a/samples/client/petstore/python/petstore_api/models/enum_test.py b/samples/client/petstore/python/petstore_api/models/enum_test.py index 1bb234764abb..565975d725c8 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python/petstore_api/models/enum_test.py @@ -34,6 +34,7 @@ class EnumTest(object): """ swagger_types = { 'enum_string': 'str', + 'enum_string_required': 'str', 'enum_integer': 'int', 'enum_number': 'float', 'outer_enum': 'OuterEnum' @@ -41,15 +42,17 @@ class EnumTest(object): attribute_map = { 'enum_string': 'enum_string', + 'enum_string_required': 'enum_string_required', 'enum_integer': 'enum_integer', 'enum_number': 'enum_number', 'outer_enum': 'outerEnum' } - def __init__(self, enum_string=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501 + def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501 """EnumTest - a model defined in Swagger""" # noqa: E501 self._enum_string = None + self._enum_string_required = None self._enum_integer = None self._enum_number = None self._outer_enum = None @@ -57,6 +60,7 @@ def __init__(self, enum_string=None, enum_integer=None, enum_number=None, outer_ if enum_string is not None: self.enum_string = enum_string + self.enum_string_required = enum_string_required if enum_integer is not None: self.enum_integer = enum_integer if enum_number is not None: @@ -91,6 +95,35 @@ def enum_string(self, enum_string): self._enum_string = enum_string + @property + def enum_string_required(self): + """Gets the enum_string_required of this EnumTest. # noqa: E501 + + + :return: The enum_string_required of this EnumTest. # noqa: E501 + :rtype: str + """ + return self._enum_string_required + + @enum_string_required.setter + def enum_string_required(self, enum_string_required): + """Sets the enum_string_required of this EnumTest. + + + :param enum_string_required: The enum_string_required of this EnumTest. # noqa: E501 + :type: str + """ + if enum_string_required is None: + raise ValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501 + allowed_values = ["UPPER", "lower", ""] # noqa: E501 + if enum_string_required not in allowed_values: + raise ValueError( + "Invalid value for `enum_string_required` ({0}), must be one of {1}" # noqa: E501 + .format(enum_string_required, allowed_values) + ) + + self._enum_string_required = enum_string_required + @property def enum_integer(self): """Gets the enum_integer of this EnumTest. # noqa: E501 diff --git a/samples/client/petstore/python/petstore_api/models/format_test.py b/samples/client/petstore/python/petstore_api/models/format_test.py index 7974d732fda9..467b4a2573d0 100644 --- a/samples/client/petstore/python/petstore_api/models/format_test.py +++ b/samples/client/petstore/python/petstore_api/models/format_test.py @@ -35,12 +35,12 @@ class FormatTest(object): 'int32': 'int', 'int64': 'int', 'number': 'float', - 'float': 'float', + '_float': 'float', 'double': 'float', 'string': 'str', 'byte': 'str', 'binary': 'str', - 'date': 'date', + '_date': 'date', 'date_time': 'datetime', 'uuid': 'str', 'password': 'str' @@ -51,30 +51,30 @@ class FormatTest(object): 'int32': 'int32', 'int64': 'int64', 'number': 'number', - 'float': 'float', + '_float': 'float', 'double': 'double', 'string': 'string', 'byte': 'byte', 'binary': 'binary', - 'date': 'date', + '_date': 'date', 'date_time': 'dateTime', 'uuid': 'uuid', 'password': 'password' } - def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None): # noqa: E501 + def __init__(self, integer=None, int32=None, int64=None, number=None, _float=None, double=None, string=None, byte=None, binary=None, _date=None, date_time=None, uuid=None, password=None): # noqa: E501 """FormatTest - a model defined in Swagger""" # noqa: E501 self._integer = None self._int32 = None self._int64 = None self._number = None - self._float = None + self.__float = None self._double = None self._string = None self._byte = None self._binary = None - self._date = None + self.__date = None self._date_time = None self._uuid = None self._password = None @@ -87,8 +87,8 @@ def __init__(self, integer=None, int32=None, int64=None, number=None, float=None if int64 is not None: self.int64 = int64 self.number = number - if float is not None: - self.float = float + if _float is not None: + self._float = _float if double is not None: self.double = double if string is not None: @@ -96,7 +96,7 @@ def __init__(self, integer=None, int32=None, int64=None, number=None, float=None self.byte = byte if binary is not None: self.binary = binary - self.date = date + self._date = _date if date_time is not None: self.date_time = date_time if uuid is not None: @@ -202,29 +202,29 @@ def number(self, number): self._number = number @property - def float(self): - """Gets the float of this FormatTest. # noqa: E501 + def _float(self): + """Gets the _float of this FormatTest. # noqa: E501 - :return: The float of this FormatTest. # noqa: E501 + :return: The _float of this FormatTest. # noqa: E501 :rtype: float """ - return self._float + return self.__float - @float.setter - def float(self, float): - """Sets the float of this FormatTest. + @_float.setter + def _float(self, _float): + """Sets the _float of this FormatTest. - :param float: The float of this FormatTest. # noqa: E501 + :param _float: The _float of this FormatTest. # noqa: E501 :type: float """ - if float is not None and float > 987.6: # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501 - if float is not None and float < 54.3: # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") # noqa: E501 + if _float is not None and _float > 987.6: # noqa: E501 + raise ValueError("Invalid value for `_float`, must be a value less than or equal to `987.6`") # noqa: E501 + if _float is not None and _float < 54.3: # noqa: E501 + raise ValueError("Invalid value for `_float`, must be a value greater than or equal to `54.3`") # noqa: E501 - self._float = float + self.__float = _float @property def double(self): @@ -321,27 +321,27 @@ def binary(self, binary): self._binary = binary @property - def date(self): - """Gets the date of this FormatTest. # noqa: E501 + def _date(self): + """Gets the _date of this FormatTest. # noqa: E501 - :return: The date of this FormatTest. # noqa: E501 + :return: The _date of this FormatTest. # noqa: E501 :rtype: date """ - return self._date + return self.__date - @date.setter - def date(self, date): - """Sets the date of this FormatTest. + @_date.setter + def _date(self, _date): + """Sets the _date of this FormatTest. - :param date: The date of this FormatTest. # noqa: E501 + :param _date: The _date of this FormatTest. # noqa: E501 :type: date """ - if date is None: - raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 + if _date is None: + raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 - self._date = date + self.__date = _date @property def date_time(self): diff --git a/samples/server/petstore/flaskConnexion-python2/.swagger-codegen/VERSION b/samples/server/petstore/flaskConnexion-python2/.swagger-codegen/VERSION index f9f7450d1359..855ff9501eb8 100644 --- a/samples/server/petstore/flaskConnexion-python2/.swagger-codegen/VERSION +++ b/samples/server/petstore/flaskConnexion-python2/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/controllers/user_controller.py b/samples/server/petstore/flaskConnexion-python2/swagger_server/controllers/user_controller.py index c7c3ee3519ab..a216b494a40d 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/controllers/user_controller.py +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/controllers/user_controller.py @@ -68,7 +68,7 @@ def get_user_by_name(username): # noqa: E501 # noqa: E501 - :param username: The name that needs to be fetched. Use user1 for testing. + :param username: The name that needs to be fetched. Use user1 for testing. :type username: str :rtype: User diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml b/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml index 836d533de5ca..ecb1f39c6021 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml @@ -525,7 +525,7 @@ paths: parameters: - name: "username" in: "path" - description: "The name that needs to be fetched. Use user1 for testing. " + description: "The name that needs to be fetched. Use user1 for testing." required: true type: "string" responses: diff --git a/samples/server/petstore/flaskConnexion/.swagger-codegen/VERSION b/samples/server/petstore/flaskConnexion/.swagger-codegen/VERSION index f9f7450d1359..855ff9501eb8 100644 --- a/samples/server/petstore/flaskConnexion/.swagger-codegen/VERSION +++ b/samples/server/petstore/flaskConnexion/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/flaskConnexion/swagger_server/controllers/user_controller.py b/samples/server/petstore/flaskConnexion/swagger_server/controllers/user_controller.py index c7c3ee3519ab..a216b494a40d 100644 --- a/samples/server/petstore/flaskConnexion/swagger_server/controllers/user_controller.py +++ b/samples/server/petstore/flaskConnexion/swagger_server/controllers/user_controller.py @@ -68,7 +68,7 @@ def get_user_by_name(username): # noqa: E501 # noqa: E501 - :param username: The name that needs to be fetched. Use user1 for testing. + :param username: The name that needs to be fetched. Use user1 for testing. :type username: str :rtype: User diff --git a/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml b/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml index 836d533de5ca..ecb1f39c6021 100644 --- a/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml +++ b/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml @@ -525,7 +525,7 @@ paths: parameters: - name: "username" in: "path" - description: "The name that needs to be fetched. Use user1 for testing. " + description: "The name that needs to be fetched. Use user1 for testing." required: true type: "string" responses: