diff --git a/bin/python-flask-petstore-python2.sh b/bin/python-flask-petstore-python2.sh index ce6aea3454d..44e58e1b962 100755 --- a/bin/python-flask-petstore-python2.sh +++ b/bin/python-flask-petstore-python2.sh @@ -27,7 +27,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" #ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l python-flask -o samples/server/petstore/flaskConnexion-python2 -DsupportPython2=true" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/flaskConnexion -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l python-flask -o samples/server/petstore/flaskConnexion-python2 -c bin/supportPython2.json -D service" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/flaskConnexion -i modules/swagger-codegen/src/test/resources/2_0/petstore-flask.yaml -l python-flask -o samples/server/petstore/flaskConnexion-python2 -c bin/supportPython2.json -D service" rm -rf samples/server/petstore/flaskConnexion-python2/* java $JAVA_OPTS -jar $executable $ags diff --git a/bin/python-flask-petstore.sh b/bin/python-flask-petstore.sh index 9bec96aaecc..f9f2b63aa94 100755 --- a/bin/python-flask-petstore.sh +++ b/bin/python-flask-petstore.sh @@ -26,7 +26,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/flaskConnexion -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l python-flask -o samples/server/petstore/flaskConnexion -Dservice" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/flaskConnexion -i modules/swagger-codegen/src/test/resources/2_0/petstore-flask.yaml -l python-flask -o samples/server/petstore/flaskConnexion -Dservice" rm -rf samples/server/petstore/flaskConnexion/* java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/resources/flaskConnexion/model.mustache b/modules/swagger-codegen/src/main/resources/flaskConnexion/model.mustache index ba289ef4f8c..7bb398f9f73 100644 --- a/modules/swagger-codegen/src/main/resources/flaskConnexion/model.mustache +++ b/modules/swagger-codegen/src/main/resources/flaskConnexion/model.mustache @@ -138,7 +138,7 @@ class {{classname}}(Model): raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 {{/minimum}} {{#pattern}} - if {{name}} is not None and not re.search('{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 + if {{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 raise ValueError("Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501 {{/pattern}} {{#maxItems}} diff --git a/modules/swagger-codegen/src/main/resources/python/api.mustache b/modules/swagger-codegen/src/main/resources/python/api.mustache index 878bbf69bdb..89fcc0c82fc 100644 --- a/modules/swagger-codegen/src/main/resources/python/api.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api.mustache @@ -27,7 +27,7 @@ class {{classname}}(object): {{#operation}} def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501 - """{{#summary}}{{.}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 + """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 {{#notes}} {{{notes}}} # noqa: E501 @@ -58,7 +58,7 @@ class {{classname}}(object): return data def {{operationId}}_with_http_info(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501 - """{{#summary}}{{.}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 + """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 {{#notes}} {{{notes}}} # noqa: E501 @@ -127,7 +127,7 @@ class {{classname}}(object): raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 {{/minimum}} {{#pattern}} - if '{{paramName}}' in params and not re.search('{{{vendorExtensions.x-regex}}}', params['{{paramName}}']{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 + if '{{paramName}}' in params and not re.search(r'{{{vendorExtensions.x-regex}}}', params['{{paramName}}']{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must conform to the pattern `{{{pattern}}}`") # noqa: E501 {{/pattern}} {{#maxItems}} diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index b3843f43237..50ec72c0205 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -251,12 +251,12 @@ class ApiClient(object): if type(klass) == str: if klass.startswith('list['): - sub_kls = re.match('list\[(.*)\]', klass).group(1) + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('dict('): - sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) return {k: self.__deserialize(v, sub_kls) for k, v in six.iteritems(data)} diff --git a/modules/swagger-codegen/src/main/resources/python/model.mustache b/modules/swagger-codegen/src/main/resources/python/model.mustache index 3bdb5ed8cb8..3fc2747fe13 100644 --- a/modules/swagger-codegen/src/main/resources/python/model.mustache +++ b/modules/swagger-codegen/src/main/resources/python/model.mustache @@ -149,8 +149,8 @@ class {{classname}}({{#parent}}{{parent}}{{/parent}}{{^parent}}object{{/parent}} raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 {{/minimum}} {{#pattern}} - if {{name}} is not None and not re.search('{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 - raise ValueError("Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501 + if {{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 + raise ValueError(r"Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501 {{/pattern}} {{#maxItems}} if {{name}} is not None and len({{name}}) > {{maxItems}}: diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-flask.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-flask.yaml new file mode 100644 index 00000000000..c5ffa98faf6 --- /dev/null +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-flask.yaml @@ -0,0 +1,704 @@ +swagger: '2.0' +info: + description: 'This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.' + version: 1.0.0 + title: Swagger Petstore + termsOfService: 'http://swagger.io/terms/' + contact: + email: apiteam@swagger.io + license: + name: Apache-2.0 + url: 'http://www.apache.org/licenses/LICENSE-2.0.html' +host: petstore.swagger.io +basePath: /v2 +tags: + - name: pet + description: Everything about your Pets + externalDocs: + description: Find out more + url: 'http://swagger.io' + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user + externalDocs: + description: Find out more about our store + url: 'http://swagger.io' +schemes: + - http +paths: + /pet: + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + consumes: + - application/json + - application/xml + produces: + - application/xml + - application/json + parameters: + - in: body + name: body + description: Pet object that needs to be added to the store + required: true + schema: + $ref: '#/definitions/Pet' + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + consumes: + - application/json + - application/xml + produces: + - application/xml + - application/json + parameters: + - in: body + name: body + description: Pet object that needs to be added to the store + required: true + schema: + $ref: '#/definitions/Pet' + responses: + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + produces: + - application/xml + - application/json + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + collectionFormat: csv + responses: + '200': + description: successful operation + schema: + type: array + items: + $ref: '#/definitions/Pet' + '400': + description: Invalid status value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: 'Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.' + operationId: findPetsByTags + produces: + - application/xml + - application/json + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + type: array + items: + type: string + collectionFormat: csv + responses: + '200': + description: successful operation + schema: + type: array + items: + $ref: '#/definitions/Pet' + '400': + description: Invalid tag value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + produces: + - application/xml + - application/json + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + type: integer + format: int64 + responses: + '200': + description: successful operation + schema: + $ref: '#/definitions/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + consumes: + - application/x-www-form-urlencoded + produces: + - application/xml + - application/json + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + type: integer + format: int64 + - name: name + in: formData + description: Updated name of the pet + required: false + type: string + - name: status + in: formData + description: Updated status of the pet + required: false + type: string + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + produces: + - application/xml + - application/json + parameters: + - name: api_key + in: header + required: false + type: string + - name: petId + in: path + description: Pet id to delete + required: true + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + consumes: + - multipart/form-data + produces: + - application/json + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + type: integer + format: int64 + - name: additionalMetadata + in: formData + description: Additional data to pass to server + required: false + type: string + - name: file + in: formData + description: file to upload + required: false + type: file + responses: + '200': + description: successful operation + schema: + $ref: '#/definitions/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + produces: + - application/json + parameters: [] + responses: + '200': + description: successful operation + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + produces: + - application/xml + - application/json + parameters: + - in: body + name: body + description: order placed for purchasing the pet + required: true + schema: + $ref: '#/definitions/Order' + responses: + '200': + description: successful operation + schema: + $ref: '#/definitions/Order' + '400': + description: Invalid Order + '/store/order/{orderId}': + get: + tags: + - store + summary: Find purchase order by ID + description: 'For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions' + operationId: getOrderById + produces: + - application/xml + - application/json + parameters: + - name: orderId + in: path + description: ID of pet that needs to be fetched + required: true + type: integer + maximum: 5 + minimum: 1 + format: int64 + responses: + '200': + description: successful operation + schema: + $ref: '#/definitions/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + operationId: deleteOrder + produces: + - application/xml + - application/json + parameters: + - name: orderId + in: path + description: ID of the order that needs to be deleted + required: true + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + produces: + - application/xml + - application/json + parameters: + - in: body + name: body + description: Created user object + required: true + schema: + $ref: '#/definitions/User' + responses: + default: + description: successful operation + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + produces: + - application/xml + - application/json + parameters: + - in: body + name: body + description: List of user object + required: true + schema: + type: array + items: + $ref: '#/definitions/User' + responses: + default: + description: successful operation + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + produces: + - application/xml + - application/json + parameters: + - in: body + name: body + description: List of user object + required: true + schema: + type: array + items: + $ref: '#/definitions/User' + responses: + default: + description: successful operation + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + produces: + - application/xml + - application/json + parameters: + - name: username + in: query + description: The user name for login + required: true + type: string + - name: password + in: query + description: The password for login in clear text + required: true + type: string + responses: + '200': + description: successful operation + schema: + type: string + headers: + X-Rate-Limit: + type: integer + format: int32 + description: calls per hour allowed by the user + X-Expires-After: + type: string + format: date-time + description: date in UTC when toekn expires + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + produces: + - application/xml + - application/json + parameters: [] + responses: + default: + description: successful operation + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + produces: + - application/xml + - application/json + parameters: + - name: username + in: path + description: 'The name that needs to be fetched. Use user1 for testing.' + required: true + type: string + responses: + '200': + description: successful operation + schema: + $ref: '#/definitions/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + produces: + - application/xml + - application/json + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + type: string + - in: body + name: body + description: Updated user object + required: true + schema: + $ref: '#/definitions/User' + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + produces: + - application/xml + - application/json + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found +securityDefinitions: + petstore_auth: + type: oauth2 + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + flow: implicit + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header +definitions: + Order: + title: Pet Order + description: An order for a pets from the pet store + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + title: Pet category + description: A category for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Category + User: + title: a User + description: A User who is purchasing from the pet store + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + title: Pet Tag + description: A tag for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + title: a Pet + description: A pet for sale in the pet store + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + category: + $ref: '#/definitions/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/definitions/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + title: An uploaded response + description: Describes the result of uploading an image resource + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string 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 226d751bb2c..a3be46de1e0 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 @@ -483,7 +483,7 @@ def test_body_with_query_params_with_http_info(self, body, query, **kwargs): # collection_formats=collection_formats) def test_client_model(self, body, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 + """To test \"client\" model # noqa: E501 To test \"client\" model # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -505,7 +505,7 @@ def test_client_model(self, body, **kwargs): # noqa: E501 return data def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 + """To test \"client\" model # noqa: E501 To test \"client\" model # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -685,7 +685,7 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501 if 'double' in params and params['double'] < 67.8: # noqa: E501 raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501 - if 'pattern_without_delimiter' in params and not re.search('^[A-Z].*', params['pattern_without_delimiter']): # noqa: E501 + if 'pattern_without_delimiter' in params and not re.search(r'^[A-Z].*', params['pattern_without_delimiter']): # noqa: E501 raise ValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501 if 'integer' in params and params['integer'] > 100: # noqa: E501 raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501 @@ -697,7 +697,7 @@ 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 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 'string' in params and not re.search('[a-z]', params['string'], flags=re.IGNORECASE): # noqa: E501 + if 'string' in params and not re.search(r'[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 len(params['password']) > 64): 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 23c38d6d15e..0a20fdc5c61 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -245,12 +245,12 @@ def __deserialize(self, data, klass): if type(klass) == str: if klass.startswith('list['): - sub_kls = re.match('list\[(.*)\]', klass).group(1) + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('dict('): - sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) return {k: self.__deserialize(v, sub_kls) for k, v in six.iteritems(data)} @@ -614,6 +614,12 @@ def __deserialize_model(self, data, klass): instance = klass(**kwargs) + if (isinstance(instance, dict) and + klass.swagger_types is not None and + isinstance(data, dict)): + for key, value in data.items(): + if key not in klass.swagger_types: + instance[key] = value if hasattr(instance, 'get_real_child_model'): klass_name = instance.get_real_child_model(data) if klass_name: diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py index 03dbe975f1b..83de7092668 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py @@ -115,6 +115,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(AdditionalPropertiesClass, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/animal.py b/samples/client/petstore/python-asyncio/petstore_api/models/animal.py index 390ac83905e..5175148b2d3 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/animal.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/animal.py @@ -126,6 +126,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Animal, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/animal_farm.py b/samples/client/petstore/python-asyncio/petstore_api/models/animal_farm.py index 6371257286e..e7904d7fbf6 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/animal_farm.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/animal_farm.py @@ -63,6 +63,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(AnimalFarm, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/api_response.py b/samples/client/petstore/python-asyncio/petstore_api/models/api_response.py index 45c4831bb10..9da53da373b 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/api_response.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/api_response.py @@ -141,6 +141,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ApiResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py index c6b363f19d8..1e5e8be1ed1 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ArrayOfArrayOfNumberOnly, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py index 240362696cd..0628f7af1e7 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ArrayOfNumberOnly, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/array_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/array_test.py index c5cd6bfe159..aa2d0d5e633 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/array_test.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/array_test.py @@ -143,6 +143,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ArrayTest, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py b/samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py index 309642bdeff..83b0068aee2 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py @@ -221,6 +221,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Capitalization, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/cat.py b/samples/client/petstore/python-asyncio/petstore_api/models/cat.py index 526d3e2aaf5..3660f18706b 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/cat.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/cat.py @@ -19,7 +19,7 @@ from petstore_api.models.animal import Animal # noqa: F401,E501 -class Cat(object): +class Cat(Animal): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -91,6 +91,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Cat, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/category.py b/samples/client/petstore/python-asyncio/petstore_api/models/category.py index 02d393af888..dbc4fd28816 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/category.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/category.py @@ -115,6 +115,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Category, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/class_model.py b/samples/client/petstore/python-asyncio/petstore_api/models/class_model.py index 4bcb19b8dc2..6042036beb5 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/class_model.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/class_model.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ClassModel, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/client.py b/samples/client/petstore/python-asyncio/petstore_api/models/client.py index e267fed6d8c..337100c3946 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/client.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Client, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/dog.py b/samples/client/petstore/python-asyncio/petstore_api/models/dog.py index 34aac6aaad4..3d80d6442f4 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/dog.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/dog.py @@ -19,7 +19,7 @@ from petstore_api.models.animal import Animal # noqa: F401,E501 -class Dog(object): +class Dog(Animal): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -91,6 +91,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Dog, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py b/samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py index d02be298d2f..5257b181b88 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py @@ -128,6 +128,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(EnumArrays, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py b/samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py index e4721545e83..2282270dda1 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py @@ -68,6 +68,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(EnumClass, dict): + for key, value in self.items(): + result[key] = value return result 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 565975d725c..d977ef918bc 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 @@ -220,6 +220,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(EnumTest, dict): + for key, value in self.items(): + result[key] = value return result 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 467b4a2573d..206b991719d 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 @@ -269,8 +269,8 @@ def string(self, string): :param string: The string of this FormatTest. # noqa: E501 :type: str """ - if string is not None and not re.search('[a-z]', string, flags=re.IGNORECASE): # noqa: E501 - raise ValueError("Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 + if string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE): # noqa: E501 + raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 self._string = string @@ -294,8 +294,8 @@ def byte(self, byte): """ if byte is None: raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 - if byte is not None and not re.search('^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): # noqa: E501 - raise ValueError("Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 + if byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): # noqa: E501 + raise ValueError(r"Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 self._byte = byte @@ -433,6 +433,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(FormatTest, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py index 3c93eb30996..76e5ceb1e22 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py @@ -115,6 +115,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(HasOnlyReadOnly, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/list.py b/samples/client/petstore/python-asyncio/petstore_api/models/list.py index fbe30e6d01e..46eef1e90f3 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/list.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/list.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(List, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py index 374c0661ba5..f2633c30a99 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py @@ -122,6 +122,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(MapTest, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py index dba1f261352..dfed6cc90bd 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -143,6 +143,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(MixedPropertiesAndAdditionalPropertiesClass, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/model200_response.py b/samples/client/petstore/python-asyncio/petstore_api/models/model200_response.py index 60f9c96a676..1fcaabca10e 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/model200_response.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/model200_response.py @@ -115,6 +115,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Model200Response, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/model_return.py b/samples/client/petstore/python-asyncio/petstore_api/models/model_return.py index c9d8b5682aa..79253611495 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/model_return.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/model_return.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ModelReturn, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/name.py b/samples/client/petstore/python-asyncio/petstore_api/models/name.py index cbfbddeb1ab..53be7953ea9 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/name.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/name.py @@ -168,6 +168,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Name, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/number_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/number_only.py index b96321109b9..2f43a834f8b 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/number_only.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/number_only.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(NumberOnly, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/order.py b/samples/client/petstore/python-asyncio/petstore_api/models/order.py index 6636542e941..9291652787e 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/order.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/order.py @@ -227,6 +227,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Order, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_boolean.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_boolean.py index 9b3aebd3608..3b273333e75 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/outer_boolean.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/outer_boolean.py @@ -61,6 +61,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(OuterBoolean, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py index 19775255e4e..36381acb861 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py @@ -145,6 +145,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(OuterComposite, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py index 5ee1e49a587..bea07410cf2 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py @@ -68,6 +68,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(OuterEnum, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_number.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_number.py index a35587be65e..a60e97c8288 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/outer_number.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/outer_number.py @@ -61,6 +61,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(OuterNumber, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_string.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_string.py index 736edacd1bc..622589ce2f6 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/outer_string.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/outer_string.py @@ -61,6 +61,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(OuterString, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/pet.py b/samples/client/petstore/python-asyncio/petstore_api/models/pet.py index 81b2bb617f9..c7c206c7a93 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/pet.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/pet.py @@ -232,6 +232,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Pet, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py b/samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py index 106463077e8..0a378f93da6 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py @@ -115,6 +115,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ReadOnlyFirst, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py b/samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py index a31b8db66e2..3817430b656 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(SpecialModelName, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/tag.py b/samples/client/petstore/python-asyncio/petstore_api/models/tag.py index b486a672b88..dc3c0b5645f 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/tag.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/tag.py @@ -115,6 +115,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Tag, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/user.py b/samples/client/petstore/python-asyncio/petstore_api/models/user.py index c9fe0072a9c..8dcac91845f 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/user.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/user.py @@ -273,6 +273,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(User, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/README.md b/samples/client/petstore/python-tornado/README.md index a49d99c556c..cab8b4c968d 100644 --- a/samples/client/petstore/python-tornado/README.md +++ b/samples/client/petstore/python-tornado/README.md @@ -50,8 +50,9 @@ 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.AnotherFakeApi() +api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration)) body = petstore_api.Client() # Client | client model try: @@ -74,6 +75,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 94dd4864629..c4c1630250f 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 1da84500bfe..37539a02aa6 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 3e489e863fa..2026ed877f8 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/another_fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py index 0096dad1a37..955369935ea 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py @@ -38,18 +38,18 @@ def test_special_tags(self, body, **kwargs): # noqa: E501 To test special tags # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.test_special_tags(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_special_tags(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param Client body: client model (required) :return: Client If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.test_special_tags_with_http_info(body, **kwargs) # noqa: E501 else: (data) = self.test_special_tags_with_http_info(body, **kwargs) # noqa: E501 @@ -60,11 +60,11 @@ def test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501 To test special tags # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.test_special_tags_with_http_info(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_special_tags_with_http_info(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param Client body: client model (required) :return: Client If the method is called asynchronously, @@ -72,7 +72,7 @@ def test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501 """ all_params = ['body'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -126,7 +126,7 @@ def test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501 files=local_var_files, response_type='Client', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), 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 4c52ee51647..a3be46de1e0 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 @@ -38,18 +38,18 @@ def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 Test serialization of outer boolean types # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.fake_outer_boolean_serialize(async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_boolean_serialize(async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param OuterBoolean body: Input boolean as post body :return: OuterBoolean If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 else: (data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 @@ -60,11 +60,11 @@ def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 Test serialization of outer boolean types # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.fake_outer_boolean_serialize_with_http_info(async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param OuterBoolean body: Input boolean as post body :return: OuterBoolean If the method is called asynchronously, @@ -72,7 +72,7 @@ def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 """ all_params = ['body'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -114,7 +114,7 @@ def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 files=local_var_files, response_type='OuterBoolean', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -125,18 +125,18 @@ def fake_outer_composite_serialize(self, **kwargs): # noqa: E501 Test serialization of object with outer number type # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.fake_outer_composite_serialize(async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_composite_serialize(async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param OuterComposite body: Input composite as post body :return: OuterComposite If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 else: (data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 @@ -147,11 +147,11 @@ def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 Test serialization of object with outer number type # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.fake_outer_composite_serialize_with_http_info(async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param OuterComposite body: Input composite as post body :return: OuterComposite If the method is called asynchronously, @@ -159,7 +159,7 @@ def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 """ all_params = ['body'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -201,7 +201,7 @@ def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 files=local_var_files, response_type='OuterComposite', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -212,18 +212,18 @@ def fake_outer_number_serialize(self, **kwargs): # noqa: E501 Test serialization of outer number types # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.fake_outer_number_serialize(async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_number_serialize(async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param OuterNumber body: Input number as post body :return: OuterNumber If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 else: (data) = self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 @@ -234,11 +234,11 @@ def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 Test serialization of outer number types # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.fake_outer_number_serialize_with_http_info(async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param OuterNumber body: Input number as post body :return: OuterNumber If the method is called asynchronously, @@ -246,7 +246,7 @@ def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 """ all_params = ['body'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -288,7 +288,7 @@ def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 files=local_var_files, response_type='OuterNumber', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -299,18 +299,18 @@ def fake_outer_string_serialize(self, **kwargs): # noqa: E501 Test serialization of outer string types # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.fake_outer_string_serialize(async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_string_serialize(async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param OuterString body: Input string as post body :return: OuterString If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 else: (data) = self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 @@ -321,11 +321,11 @@ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 Test serialization of outer string types # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.fake_outer_string_serialize_with_http_info(async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param OuterString body: Input string as post body :return: OuterString If the method is called asynchronously, @@ -333,7 +333,7 @@ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 """ all_params = ['body'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -375,44 +375,145 @@ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 files=local_var_files, response_type='OuterString', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), + _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_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_req=True + >>> thread = api.test_body_with_query_params(body, query, async_req=True) + >>> result = thread.get() + + :param async_req 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_req'): + 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_req=True + >>> thread = api.test_body_with_query_params_with_http_info(body, query, async_req=True) + >>> result = thread.get() + + :param async_req 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_req') + 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_req=params.get('async_req'), _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 + """To test \"client\" model # noqa: E501 To test \"client\" model # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.test_client_model(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_client_model(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param Client body: client model (required) :return: Client If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 else: (data) = self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 return data def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 + """To test \"client\" model # noqa: E501 To test \"client\" model # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.test_client_model_with_http_info(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_client_model_with_http_info(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param Client body: client model (required) :return: Client If the method is called asynchronously, @@ -420,7 +521,7 @@ def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 """ all_params = ['body'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -474,7 +575,7 @@ def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 files=local_var_files, response_type='Client', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -485,11 +586,11 @@ def test_endpoint_parameters(self, number, double, pattern_without_delimiter, by Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param float number: None (required) :param float double: None (required) :param str pattern_without_delimiter: None (required) @@ -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 @@ -509,7 +610,7 @@ def test_endpoint_parameters(self, number, double, pattern_without_delimiter, by returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 else: (data) = self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 @@ -520,11 +621,11 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param float number: None (required) :param float double: None (required) :param str pattern_without_delimiter: None (required) @@ -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,8 +645,8 @@ 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.append('async') + 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_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -584,7 +685,7 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501 if 'double' in params and params['double'] < 67.8: # noqa: E501 raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501 - if 'pattern_without_delimiter' in params and not re.search('^[A-Z].*', params['pattern_without_delimiter']): # noqa: E501 + if 'pattern_without_delimiter' in params and not re.search(r'^[A-Z].*', params['pattern_without_delimiter']): # noqa: E501 raise ValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501 if 'integer' in params and params['integer'] > 100: # noqa: E501 raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501 @@ -594,9 +695,9 @@ 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 'string' in params and not re.search('[a-z]', params['string'], flags=re.IGNORECASE): # 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(r'[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 len(params['password']) > 64): @@ -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: @@ -665,7 +766,7 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -676,11 +777,11 @@ def test_enum_parameters(self, **kwargs): # noqa: E501 To test enum parameters # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.test_enum_parameters(async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_enum_parameters(async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param list[str] enum_form_string_array: Form parameter enum test (string array) :param str enum_form_string: Form parameter enum test (string) :param list[str] enum_header_string_array: Header parameter enum test (string array) @@ -694,7 +795,7 @@ def test_enum_parameters(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 else: (data) = self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 @@ -705,11 +806,11 @@ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 To test enum parameters # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.test_enum_parameters_with_http_info(async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_enum_parameters_with_http_info(async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param list[str] enum_form_string_array: Form parameter enum test (string array) :param str enum_form_string: Form parameter enum test (string) :param list[str] enum_header_string_array: Header parameter enum test (string array) @@ -724,7 +825,7 @@ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 """ all_params = ['enum_form_string_array', 'enum_form_string', 'enum_header_string_array', 'enum_header_string', 'enum_query_string_array', 'enum_query_string', 'enum_query_integer', 'enum_query_double'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -791,7 +892,7 @@ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -802,18 +903,18 @@ def test_inline_additional_properties(self, param, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.test_inline_additional_properties(param, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_inline_additional_properties(param, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param object param: request body (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 else: (data) = self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 @@ -824,11 +925,11 @@ def test_inline_additional_properties_with_http_info(self, param, **kwargs): # # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.test_inline_additional_properties_with_http_info(param, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_inline_additional_properties_with_http_info(param, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param object param: request body (required) :return: None If the method is called asynchronously, @@ -836,7 +937,7 @@ def test_inline_additional_properties_with_http_info(self, param, **kwargs): # """ all_params = ['param'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -886,7 +987,7 @@ def test_inline_additional_properties_with_http_info(self, param, **kwargs): # files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -897,11 +998,11 @@ def test_json_form_data(self, param, param2, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.test_json_form_data(param, param2, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_json_form_data(param, param2, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param str param: field1 (required) :param str param2: field2 (required) :return: None @@ -909,7 +1010,7 @@ def test_json_form_data(self, param, param2, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 else: (data) = self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 @@ -920,11 +1021,11 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.test_json_form_data_with_http_info(param, param2, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param str param: field1 (required) :param str param2: field2 (required) :return: None @@ -933,7 +1034,7 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: """ all_params = ['param', 'param2'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -989,7 +1090,7 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py index 230aa5ec4fc..8aa93d8dc32 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py @@ -38,18 +38,18 @@ def test_classname(self, body, **kwargs): # noqa: E501 To test class name in snake case # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.test_classname(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_classname(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param Client body: client model (required) :return: Client If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.test_classname_with_http_info(body, **kwargs) # noqa: E501 else: (data) = self.test_classname_with_http_info(body, **kwargs) # noqa: E501 @@ -60,11 +60,11 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 To test class name in snake case # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.test_classname_with_http_info(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_classname_with_http_info(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param Client body: client model (required) :return: Client If the method is called asynchronously, @@ -72,7 +72,7 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 """ all_params = ['body'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -126,7 +126,7 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 files=local_var_files, response_type='Client', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), diff --git a/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py b/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py index ff1026f3fae..bf71e96eab6 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py @@ -38,18 +38,18 @@ def add_pet(self, body, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.add_pet(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_pet(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param Pet body: Pet object that needs to be added to the store (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.add_pet_with_http_info(body, **kwargs) # noqa: E501 else: (data) = self.add_pet_with_http_info(body, **kwargs) # noqa: E501 @@ -60,11 +60,11 @@ def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.add_pet_with_http_info(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_pet_with_http_info(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param Pet body: Pet object that needs to be added to the store (required) :return: None If the method is called asynchronously, @@ -72,7 +72,7 @@ def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 """ all_params = ['body'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -126,7 +126,7 @@ def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -137,11 +137,11 @@ def delete_pet(self, pet_id, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.delete_pet(pet_id, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_pet(pet_id, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param int pet_id: Pet id to delete (required) :param str api_key: :return: None @@ -149,7 +149,7 @@ def delete_pet(self, pet_id, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 else: (data) = self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 @@ -160,11 +160,11 @@ def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.delete_pet_with_http_info(pet_id, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_pet_with_http_info(pet_id, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param int pet_id: Pet id to delete (required) :param str api_key: :return: None @@ -173,7 +173,7 @@ def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 """ all_params = ['pet_id', 'api_key'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -225,7 +225,7 @@ def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -236,18 +236,18 @@ def find_pets_by_status(self, status, **kwargs): # noqa: E501 Multiple status values can be provided with comma separated strings # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.find_pets_by_status(status, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_status(status, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param list[str] status: Status values that need to be considered for filter (required) :return: list[Pet] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 else: (data) = self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 @@ -258,11 +258,11 @@ def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 Multiple status values can be provided with comma separated strings # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.find_pets_by_status_with_http_info(status, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_status_with_http_info(status, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param list[str] status: Status values that need to be considered for filter (required) :return: list[Pet] If the method is called asynchronously, @@ -270,7 +270,7 @@ def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 """ all_params = ['status'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -321,7 +321,7 @@ def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 files=local_var_files, response_type='list[Pet]', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -332,18 +332,18 @@ def find_pets_by_tags(self, tags, **kwargs): # noqa: E501 Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.find_pets_by_tags(tags, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_tags(tags, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param list[str] tags: Tags to filter by (required) :return: list[Pet] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 else: (data) = self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 @@ -354,11 +354,11 @@ def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.find_pets_by_tags_with_http_info(tags, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param list[str] tags: Tags to filter by (required) :return: list[Pet] If the method is called asynchronously, @@ -366,7 +366,7 @@ def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 """ all_params = ['tags'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -417,7 +417,7 @@ def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 files=local_var_files, response_type='list[Pet]', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -428,18 +428,18 @@ def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 Returns a single pet # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.get_pet_by_id(pet_id, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_pet_by_id(pet_id, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param int pet_id: ID of pet to return (required) :return: Pet If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 else: (data) = self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 @@ -450,11 +450,11 @@ def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 Returns a single pet # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.get_pet_by_id_with_http_info(pet_id, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_pet_by_id_with_http_info(pet_id, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param int pet_id: ID of pet to return (required) :return: Pet If the method is called asynchronously, @@ -462,7 +462,7 @@ def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 """ all_params = ['pet_id'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -512,7 +512,7 @@ def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 files=local_var_files, response_type='Pet', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -523,18 +523,18 @@ def update_pet(self, body, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.update_pet(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param Pet body: Pet object that needs to be added to the store (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.update_pet_with_http_info(body, **kwargs) # noqa: E501 else: (data) = self.update_pet_with_http_info(body, **kwargs) # noqa: E501 @@ -545,11 +545,11 @@ def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.update_pet_with_http_info(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet_with_http_info(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param Pet body: Pet object that needs to be added to the store (required) :return: None If the method is called asynchronously, @@ -557,7 +557,7 @@ def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 """ all_params = ['body'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -611,7 +611,7 @@ def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -622,11 +622,11 @@ def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.update_pet_with_form(pet_id, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet_with_form(pet_id, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param int pet_id: ID of pet that needs to be updated (required) :param str name: Updated name of the pet :param str status: Updated status of the pet @@ -635,7 +635,7 @@ def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501 else: (data) = self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501 @@ -646,11 +646,11 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.update_pet_with_form_with_http_info(pet_id, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param int pet_id: ID of pet that needs to be updated (required) :param str name: Updated name of the pet :param str status: Updated status of the pet @@ -660,7 +660,7 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 """ all_params = ['pet_id', 'name', 'status'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -718,7 +718,7 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -729,11 +729,11 @@ def upload_file(self, pet_id, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.upload_file(pet_id, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file(pet_id, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param int pet_id: ID of pet to update (required) :param str additional_metadata: Additional data to pass to server :param file file: file to upload @@ -742,7 +742,7 @@ def upload_file(self, pet_id, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 else: (data) = self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 @@ -753,11 +753,11 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.upload_file_with_http_info(pet_id, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file_with_http_info(pet_id, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param int pet_id: ID of pet to update (required) :param str additional_metadata: Additional data to pass to server :param file file: file to upload @@ -767,7 +767,7 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 """ all_params = ['pet_id', 'additional_metadata', 'file'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -825,7 +825,7 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 files=local_var_files, response_type='ApiResponse', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), diff --git a/samples/client/petstore/python-tornado/petstore_api/api/store_api.py b/samples/client/petstore/python-tornado/petstore_api/api/store_api.py index ebb9a4eb27a..27e1f770192 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/store_api.py @@ -38,18 +38,18 @@ def delete_order(self, order_id, **kwargs): # noqa: E501 For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.delete_order(order_id, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_order(order_id, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param str order_id: ID of the order that needs to be deleted (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 else: (data) = self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 @@ -60,11 +60,11 @@ def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.delete_order_with_http_info(order_id, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_order_with_http_info(order_id, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param str order_id: ID of the order that needs to be deleted (required) :return: None If the method is called asynchronously, @@ -72,7 +72,7 @@ def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 """ all_params = ['order_id'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -122,7 +122,7 @@ def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -133,17 +133,17 @@ def get_inventory(self, **kwargs): # noqa: E501 Returns a map of status codes to quantities # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.get_inventory(async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_inventory(async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :return: dict(str, int) If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.get_inventory_with_http_info(**kwargs) # noqa: E501 else: (data) = self.get_inventory_with_http_info(**kwargs) # noqa: E501 @@ -154,18 +154,18 @@ def get_inventory_with_http_info(self, **kwargs): # noqa: E501 Returns a map of status codes to quantities # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.get_inventory_with_http_info(async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_inventory_with_http_info(async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :return: dict(str, int) If the method is called asynchronously, returns the request thread. """ all_params = [] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -209,7 +209,7 @@ def get_inventory_with_http_info(self, **kwargs): # noqa: E501 files=local_var_files, response_type='dict(str, int)', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -220,18 +220,18 @@ def get_order_by_id(self, order_id, **kwargs): # noqa: E501 For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.get_order_by_id(order_id, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_order_by_id(order_id, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param int order_id: ID of pet that needs to be fetched (required) :return: Order If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 else: (data) = self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 @@ -242,11 +242,11 @@ def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.get_order_by_id_with_http_info(order_id, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param int order_id: ID of pet that needs to be fetched (required) :return: Order If the method is called asynchronously, @@ -254,7 +254,7 @@ def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 """ all_params = ['order_id'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -308,7 +308,7 @@ def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 files=local_var_files, response_type='Order', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -319,18 +319,18 @@ def place_order(self, body, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.place_order(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.place_order(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param Order body: order placed for purchasing the pet (required) :return: Order If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.place_order_with_http_info(body, **kwargs) # noqa: E501 else: (data) = self.place_order_with_http_info(body, **kwargs) # noqa: E501 @@ -341,11 +341,11 @@ def place_order_with_http_info(self, body, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.place_order_with_http_info(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.place_order_with_http_info(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param Order body: order placed for purchasing the pet (required) :return: Order If the method is called asynchronously, @@ -353,7 +353,7 @@ def place_order_with_http_info(self, body, **kwargs): # noqa: E501 """ all_params = ['body'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -403,7 +403,7 @@ def place_order_with_http_info(self, body, **kwargs): # noqa: E501 files=local_var_files, response_type='Order', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), diff --git a/samples/client/petstore/python-tornado/petstore_api/api/user_api.py b/samples/client/petstore/python-tornado/petstore_api/api/user_api.py index 1de89f28bb0..62a87f2e418 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/user_api.py @@ -38,18 +38,18 @@ def create_user(self, body, **kwargs): # noqa: E501 This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.create_user(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_user(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param User body: Created user object (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.create_user_with_http_info(body, **kwargs) # noqa: E501 else: (data) = self.create_user_with_http_info(body, **kwargs) # noqa: E501 @@ -60,11 +60,11 @@ def create_user_with_http_info(self, body, **kwargs): # noqa: E501 This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.create_user_with_http_info(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_user_with_http_info(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param User body: Created user object (required) :return: None If the method is called asynchronously, @@ -72,7 +72,7 @@ def create_user_with_http_info(self, body, **kwargs): # noqa: E501 """ all_params = ['body'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -122,7 +122,7 @@ def create_user_with_http_info(self, body, **kwargs): # noqa: E501 files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -133,18 +133,18 @@ def create_users_with_array_input(self, body, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.create_users_with_array_input(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_array_input(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param list[User] body: List of user object (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501 else: (data) = self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501 @@ -155,11 +155,11 @@ def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.create_users_with_array_input_with_http_info(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_array_input_with_http_info(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param list[User] body: List of user object (required) :return: None If the method is called asynchronously, @@ -167,7 +167,7 @@ def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: """ all_params = ['body'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -217,7 +217,7 @@ def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -228,18 +228,18 @@ def create_users_with_list_input(self, body, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.create_users_with_list_input(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_list_input(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param list[User] body: List of user object (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501 else: (data) = self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501 @@ -250,11 +250,11 @@ def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.create_users_with_list_input_with_http_info(body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_list_input_with_http_info(body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param list[User] body: List of user object (required) :return: None If the method is called asynchronously, @@ -262,7 +262,7 @@ def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: """ all_params = ['body'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -312,7 +312,7 @@ def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -323,18 +323,18 @@ def delete_user(self, username, **kwargs): # noqa: E501 This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.delete_user(username, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_user(username, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param str username: The name that needs to be deleted (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.delete_user_with_http_info(username, **kwargs) # noqa: E501 else: (data) = self.delete_user_with_http_info(username, **kwargs) # noqa: E501 @@ -345,11 +345,11 @@ def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.delete_user_with_http_info(username, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_user_with_http_info(username, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param str username: The name that needs to be deleted (required) :return: None If the method is called asynchronously, @@ -357,7 +357,7 @@ def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 """ all_params = ['username'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -407,7 +407,7 @@ def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -418,18 +418,18 @@ def get_user_by_name(self, username, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.get_user_by_name(username, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_by_name(username, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param str username: The name that needs to be fetched. Use user1 for testing. (required) :return: User If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 else: (data) = self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 @@ -440,11 +440,11 @@ def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.get_user_by_name_with_http_info(username, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_by_name_with_http_info(username, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param str username: The name that needs to be fetched. Use user1 for testing. (required) :return: User If the method is called asynchronously, @@ -452,7 +452,7 @@ def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 """ all_params = ['username'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -502,7 +502,7 @@ def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 files=local_var_files, response_type='User', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -513,11 +513,11 @@ def login_user(self, username, password, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.login_user(username, password, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.login_user(username, password, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param str username: The user name for login (required) :param str password: The password for login in clear text (required) :return: str @@ -525,7 +525,7 @@ def login_user(self, username, password, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 else: (data) = self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 @@ -536,11 +536,11 @@ def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.login_user_with_http_info(username, password, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.login_user_with_http_info(username, password, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param str username: The user name for login (required) :param str password: The password for login in clear text (required) :return: str @@ -549,7 +549,7 @@ def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 """ all_params = ['username', 'password'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -605,7 +605,7 @@ def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 files=local_var_files, response_type='str', # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -616,17 +616,17 @@ def logout_user(self, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.logout_user(async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.logout_user(async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.logout_user_with_http_info(**kwargs) # noqa: E501 else: (data) = self.logout_user_with_http_info(**kwargs) # noqa: E501 @@ -637,18 +637,18 @@ def logout_user_with_http_info(self, **kwargs): # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.logout_user_with_http_info(async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.logout_user_with_http_info(async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :return: None If the method is called asynchronously, returns the request thread. """ all_params = [] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -692,7 +692,7 @@ def logout_user_with_http_info(self, **kwargs): # noqa: E501 files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), @@ -703,11 +703,11 @@ def update_user(self, username, body, **kwargs): # noqa: E501 This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.update_user(username, body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_user(username, body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param str username: name that need to be deleted (required) :param User body: Updated user object (required) :return: None @@ -715,7 +715,7 @@ def update_user(self, username, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async'): + if kwargs.get('async_req'): return self.update_user_with_http_info(username, body, **kwargs) # noqa: E501 else: (data) = self.update_user_with_http_info(username, body, **kwargs) # noqa: E501 @@ -726,11 +726,11 @@ def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async=True - >>> thread = api.update_user_with_http_info(username, body, async=True) + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_user_with_http_info(username, body, async_req=True) >>> result = thread.get() - :param async bool + :param async_req bool :param str username: name that need to be deleted (required) :param User body: Updated user object (required) :return: None @@ -739,7 +739,7 @@ def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 """ all_params = ['username', 'body'] # noqa: E501 - all_params.append('async') + all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') @@ -795,7 +795,7 @@ def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, - async=params.get('async'), + async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), 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 52d5e8aa081..67516ff7419 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -247,12 +247,12 @@ def __deserialize(self, data, klass): if type(klass) == str: if klass.startswith('list['): - sub_kls = re.match('list\[(.*)\]', klass).group(1) + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('dict('): - sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) return {k: self.__deserialize(v, sub_kls) for k, v in six.iteritems(data)} @@ -276,12 +276,12 @@ def __deserialize(self, data, klass): def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async=None, + response_type=None, auth_settings=None, async_req=None, _return_http_data_only=None, collection_formats=None, _preload_content=True, _request_timeout=None): """Makes the HTTP request (synchronous) and returns deserialized data. - To make an async request, set the async parameter. + To make an async request, set the async_req parameter. :param resource_path: Path to method endpoint. :param method: Method to call. @@ -296,7 +296,7 @@ def call_api(self, resource_path, method, :param response: Response data type. :param files dict: key -> filename, value -> filepath, for `multipart/form-data`. - :param async bool: execute request asynchronously + :param async_req bool: execute request asynchronously :param _return_http_data_only: response data without head status code and headers :param collection_formats: dict of collection formats for path, query, @@ -309,13 +309,13 @@ def call_api(self, resource_path, method, timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: - If async parameter is True, + If async_req parameter is True, the request will be called asynchronously. The method will return the request thread. - If parameter async is False or missing, + If parameter async_req is False or missing, then the method will return the response directly. """ - if not async: + if not async_req: return self.__call_api(resource_path, method, path_params, query_params, header_params, body, post_params, files, @@ -616,6 +616,12 @@ def __deserialize_model(self, data, klass): instance = klass(**kwargs) + if (isinstance(instance, dict) and + klass.swagger_types is not None and + isinstance(data, dict)): + for key, value in data.items(): + if key not in klass.swagger_types: + instance[key] = value if hasattr(instance, 'get_real_child_model'): klass_name = instance.get_real_child_model(data) if klass_name: diff --git a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py index 03dbe975f1b..83de7092668 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py @@ -115,6 +115,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(AdditionalPropertiesClass, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/animal.py b/samples/client/petstore/python-tornado/petstore_api/models/animal.py index 390ac83905e..5175148b2d3 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/animal.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/animal.py @@ -126,6 +126,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Animal, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/animal_farm.py b/samples/client/petstore/python-tornado/petstore_api/models/animal_farm.py index 6371257286e..e7904d7fbf6 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/animal_farm.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/animal_farm.py @@ -63,6 +63,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(AnimalFarm, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/api_response.py b/samples/client/petstore/python-tornado/petstore_api/models/api_response.py index 45c4831bb10..9da53da373b 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/api_response.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/api_response.py @@ -141,6 +141,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ApiResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py index c6b363f19d8..1e5e8be1ed1 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ArrayOfArrayOfNumberOnly, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py index 240362696cd..0628f7af1e7 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ArrayOfNumberOnly, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/array_test.py b/samples/client/petstore/python-tornado/petstore_api/models/array_test.py index c5cd6bfe159..aa2d0d5e633 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/array_test.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/array_test.py @@ -143,6 +143,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ArrayTest, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/capitalization.py b/samples/client/petstore/python-tornado/petstore_api/models/capitalization.py index 309642bdeff..83b0068aee2 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/capitalization.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/capitalization.py @@ -221,6 +221,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Capitalization, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/cat.py b/samples/client/petstore/python-tornado/petstore_api/models/cat.py index 526d3e2aaf5..3660f18706b 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/cat.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/cat.py @@ -19,7 +19,7 @@ from petstore_api.models.animal import Animal # noqa: F401,E501 -class Cat(object): +class Cat(Animal): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -91,6 +91,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Cat, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/category.py b/samples/client/petstore/python-tornado/petstore_api/models/category.py index 02d393af888..dbc4fd28816 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/category.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/category.py @@ -115,6 +115,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Category, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/class_model.py b/samples/client/petstore/python-tornado/petstore_api/models/class_model.py index 4bcb19b8dc2..6042036beb5 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/class_model.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/class_model.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ClassModel, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/client.py b/samples/client/petstore/python-tornado/petstore_api/models/client.py index e267fed6d8c..337100c3946 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/client.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/client.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Client, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/dog.py b/samples/client/petstore/python-tornado/petstore_api/models/dog.py index 34aac6aaad4..3d80d6442f4 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/dog.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/dog.py @@ -19,7 +19,7 @@ from petstore_api.models.animal import Animal # noqa: F401,E501 -class Dog(object): +class Dog(Animal): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -91,6 +91,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Dog, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py b/samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py index d02be298d2f..5257b181b88 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py @@ -128,6 +128,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(EnumArrays, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/enum_class.py b/samples/client/petstore/python-tornado/petstore_api/models/enum_class.py index e4721545e83..2282270dda1 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/enum_class.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/enum_class.py @@ -68,6 +68,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(EnumClass, dict): + for key, value in self.items(): + result[key] = value return result 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 1bb234764ab..d977ef918bc 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 @@ -187,6 +220,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(EnumTest, dict): + for key, value in self.items(): + result[key] = value return result 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 7974d732fda..206b991719d 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): @@ -269,8 +269,8 @@ def string(self, string): :param string: The string of this FormatTest. # noqa: E501 :type: str """ - if string is not None and not re.search('[a-z]', string, flags=re.IGNORECASE): # noqa: E501 - raise ValueError("Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 + if string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE): # noqa: E501 + raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 self._string = string @@ -294,8 +294,8 @@ def byte(self, byte): """ if byte is None: raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 - if byte is not None and not re.search('^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): # noqa: E501 - raise ValueError("Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 + if byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): # noqa: E501 + raise ValueError(r"Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 self._byte = byte @@ -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): @@ -433,6 +433,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(FormatTest, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py index 3c93eb30996..76e5ceb1e22 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py @@ -115,6 +115,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(HasOnlyReadOnly, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/list.py b/samples/client/petstore/python-tornado/petstore_api/models/list.py index fbe30e6d01e..46eef1e90f3 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/list.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/list.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(List, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/map_test.py b/samples/client/petstore/python-tornado/petstore_api/models/map_test.py index 374c0661ba5..f2633c30a99 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/map_test.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/map_test.py @@ -122,6 +122,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(MapTest, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py index dba1f261352..dfed6cc90bd 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -143,6 +143,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(MixedPropertiesAndAdditionalPropertiesClass, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/model200_response.py b/samples/client/petstore/python-tornado/petstore_api/models/model200_response.py index 60f9c96a676..1fcaabca10e 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/model200_response.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/model200_response.py @@ -115,6 +115,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Model200Response, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/model_return.py b/samples/client/petstore/python-tornado/petstore_api/models/model_return.py index c9d8b5682aa..79253611495 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/model_return.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/model_return.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ModelReturn, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/name.py b/samples/client/petstore/python-tornado/petstore_api/models/name.py index cbfbddeb1ab..53be7953ea9 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/name.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/name.py @@ -168,6 +168,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Name, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/number_only.py b/samples/client/petstore/python-tornado/petstore_api/models/number_only.py index b96321109b9..2f43a834f8b 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/number_only.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/number_only.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(NumberOnly, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/order.py b/samples/client/petstore/python-tornado/petstore_api/models/order.py index 6636542e941..9291652787e 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/order.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/order.py @@ -227,6 +227,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Order, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_boolean.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_boolean.py index 9b3aebd3608..3b273333e75 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/outer_boolean.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/outer_boolean.py @@ -61,6 +61,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(OuterBoolean, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py index 19775255e4e..36381acb861 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py @@ -145,6 +145,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(OuterComposite, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py index 5ee1e49a587..bea07410cf2 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py @@ -68,6 +68,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(OuterEnum, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_number.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_number.py index a35587be65e..a60e97c8288 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/outer_number.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/outer_number.py @@ -61,6 +61,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(OuterNumber, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_string.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_string.py index 736edacd1bc..622589ce2f6 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/outer_string.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/outer_string.py @@ -61,6 +61,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(OuterString, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/pet.py b/samples/client/petstore/python-tornado/petstore_api/models/pet.py index 81b2bb617f9..c7c206c7a93 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/pet.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/pet.py @@ -232,6 +232,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Pet, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py b/samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py index 106463077e8..0a378f93da6 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py @@ -115,6 +115,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ReadOnlyFirst, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py b/samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py index a31b8db66e2..3817430b656 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py @@ -89,6 +89,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(SpecialModelName, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/tag.py b/samples/client/petstore/python-tornado/petstore_api/models/tag.py index b486a672b88..dc3c0b5645f 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/tag.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/tag.py @@ -115,6 +115,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Tag, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/user.py b/samples/client/petstore/python-tornado/petstore_api/models/user.py index c9fe0072a9c..8dcac91845f 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/user.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/user.py @@ -273,6 +273,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(User, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/samples/client/petstore/python-tornado/setup.py b/samples/client/petstore/python-tornado/setup.py index 5e542baf523..ea0a40a1b06 100644 --- a/samples/client/petstore/python-tornado/setup.py +++ b/samples/client/petstore/python-tornado/setup.py @@ -23,7 +23,7 @@ # http://pypi.python.org/pypi/setuptools REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] -REQUIRES.append("tornado < 5.0") +REQUIRES.append("tornado") setup( name=NAME, diff --git a/samples/client/petstore/python/.travis.yml b/samples/client/petstore/python/.travis.yml index 00887b6fb78..86211e2d4a2 100644 --- a/samples/client/petstore/python/.travis.yml +++ b/samples/client/petstore/python/.travis.yml @@ -6,8 +6,6 @@ python: - "3.3" - "3.4" - "3.5" - - "3.6" - - "3.7" #- "3.5-dev" # 3.5 development branch #- "nightly" # points to the latest development branch e.g. 3.6-dev # command to install dependencies 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 226d751bb2c..a3be46de1e0 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -483,7 +483,7 @@ def test_body_with_query_params_with_http_info(self, body, query, **kwargs): # collection_formats=collection_formats) def test_client_model(self, body, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 + """To test \"client\" model # noqa: E501 To test \"client\" model # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -505,7 +505,7 @@ def test_client_model(self, body, **kwargs): # noqa: E501 return data def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 + """To test \"client\" model # noqa: E501 To test \"client\" model # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -685,7 +685,7 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501 if 'double' in params and params['double'] < 67.8: # noqa: E501 raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501 - if 'pattern_without_delimiter' in params and not re.search('^[A-Z].*', params['pattern_without_delimiter']): # noqa: E501 + if 'pattern_without_delimiter' in params and not re.search(r'^[A-Z].*', params['pattern_without_delimiter']): # noqa: E501 raise ValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501 if 'integer' in params and params['integer'] > 100: # noqa: E501 raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501 @@ -697,7 +697,7 @@ 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 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 'string' in params and not re.search('[a-z]', params['string'], flags=re.IGNORECASE): # noqa: E501 + if 'string' in params and not re.search(r'[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 len(params['password']) > 64): diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 4f6edcd6587..f9cf842ab2d 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -245,12 +245,12 @@ def __deserialize(self, data, klass): if type(klass) == str: if klass.startswith('list['): - sub_kls = re.match('list\[(.*)\]', klass).group(1) + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('dict('): - sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) return {k: self.__deserialize(v, sub_kls) for k, v in six.iteritems(data)} 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 9e7afc44b18..206b991719d 100644 --- a/samples/client/petstore/python/petstore_api/models/format_test.py +++ b/samples/client/petstore/python/petstore_api/models/format_test.py @@ -269,8 +269,8 @@ def string(self, string): :param string: The string of this FormatTest. # noqa: E501 :type: str """ - if string is not None and not re.search('[a-z]', string, flags=re.IGNORECASE): # noqa: E501 - raise ValueError("Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 + if string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE): # noqa: E501 + raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 self._string = string @@ -294,8 +294,8 @@ def byte(self, byte): """ if byte is None: raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 - if byte is not None and not re.search('^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): # noqa: E501 - raise ValueError("Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 + if byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): # noqa: E501 + raise ValueError(r"Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 self._byte = byte diff --git a/samples/server/petstore/flaskConnexion-python2/.swagger-codegen/VERSION b/samples/server/petstore/flaskConnexion-python2/.swagger-codegen/VERSION index f9f7450d135..855ff9501eb 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 c7c3ee3519a..a216b494a40 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 836d533de5c..11deec4cd1d 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml @@ -59,6 +59,7 @@ paths: - "write:pets" - "read:pets" x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-post-method: true put: tags: - "pet" @@ -90,6 +91,7 @@ paths: - "write:pets" - "read:pets" x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-put-method: true /pet/findByStatus: get: tags: @@ -108,11 +110,11 @@ paths: type: "array" items: type: "string" - default: "available" enum: - "available" - "pending" - "sold" + default: "available" collectionFormat: "csv" responses: 200: @@ -128,6 +130,7 @@ paths: - "write:pets" - "read:pets" x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-get-method: true /pet/findByTags: get: tags: @@ -163,6 +166,7 @@ paths: - "read:pets" deprecated: true x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-get-method: true /pet/{petId}: get: tags: @@ -192,6 +196,7 @@ paths: security: - api_key: [] x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-get-method: true post: tags: - "pet" @@ -228,6 +233,7 @@ paths: - "write:pets" - "read:pets" x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-post-method: true delete: tags: - "pet" @@ -256,6 +262,7 @@ paths: - "write:pets" - "read:pets" x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-delete-method: true /pet/{petId}/uploadImage: post: tags: @@ -294,6 +301,7 @@ paths: - "write:pets" - "read:pets" x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-post-method: true /store/inventory: get: tags: @@ -315,6 +323,7 @@ paths: security: - api_key: [] x-swagger-router-controller: "swagger_server.controllers.store_controller" + x-is-get-method: true /store/order: post: tags: @@ -340,6 +349,7 @@ paths: 400: description: "Invalid Order" x-swagger-router-controller: "swagger_server.controllers.store_controller" + x-is-post-method: true /store/order/{orderId}: get: tags: @@ -370,6 +380,7 @@ paths: 404: description: "Order not found" x-swagger-router-controller: "swagger_server.controllers.store_controller" + x-is-get-method: true delete: tags: - "store" @@ -392,6 +403,7 @@ paths: 404: description: "Order not found" x-swagger-router-controller: "swagger_server.controllers.store_controller" + x-is-delete-method: true /user: post: tags: @@ -413,6 +425,7 @@ paths: default: description: "successful operation" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-post-method: true /user/createWithArray: post: tags: @@ -436,6 +449,7 @@ paths: default: description: "successful operation" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-post-method: true /user/createWithList: post: tags: @@ -459,6 +473,7 @@ paths: default: description: "successful operation" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-post-method: true /user/login: get: tags: @@ -483,8 +498,6 @@ paths: responses: 200: description: "successful operation" - schema: - type: "string" headers: X-Rate-Limit: type: "integer" @@ -494,9 +507,12 @@ paths: type: "string" format: "date-time" description: "date in UTC when toekn expires" + schema: + type: "string" 400: description: "Invalid username/password supplied" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-get-method: true /user/logout: get: tags: @@ -512,6 +528,7 @@ paths: default: description: "successful operation" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-get-method: true /user/{username}: get: tags: @@ -525,7 +542,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: @@ -538,6 +555,7 @@ paths: 404: description: "User not found" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-get-method: true put: tags: - "user" @@ -565,6 +583,7 @@ paths: 404: description: "User not found" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-put-method: true delete: tags: - "user" @@ -586,6 +605,7 @@ paths: 404: description: "User not found" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-delete-method: true securityDefinitions: petstore_auth: type: "oauth2" @@ -625,6 +645,8 @@ definitions: type: "boolean" default: false title: "Pet Order" + xml: + name: "Order" description: "An order for a pets from the pet store" example: petId: 6 @@ -633,8 +655,6 @@ definitions: shipDate: "2000-01-23T04:56:07.000+00:00" complete: false status: "placed" - xml: - name: "Order" Category: type: "object" properties: @@ -644,12 +664,12 @@ definitions: name: type: "string" title: "Pet category" + xml: + name: "Category" description: "A category for a pet" example: name: "name" id: 6 - xml: - name: "Category" User: type: "object" properties: @@ -673,6 +693,8 @@ definitions: format: "int32" description: "User Status" title: "a User" + xml: + name: "User" description: "A User who is purchasing from the pet store" example: firstName: "firstName" @@ -683,8 +705,6 @@ definitions: id: 0 email: "email" username: "username" - xml: - name: "User" Tag: type: "object" properties: @@ -694,12 +714,12 @@ definitions: name: type: "string" title: "Pet Tag" + xml: + name: "Tag" description: "A tag for a pet" example: name: "name" id: 1 - xml: - name: "Tag" Pet: type: "object" required: @@ -736,6 +756,8 @@ definitions: - "pending" - "sold" title: "a Pet" + xml: + name: "Pet" description: "A pet for sale in the pet store" example: photoUrls: @@ -752,8 +774,6 @@ definitions: - name: "name" id: 1 status: "available" - xml: - name: "Pet" ApiResponse: type: "object" properties: @@ -770,6 +790,3 @@ definitions: code: 0 type: "type" message: "message" -externalDocs: - description: "Find out more about Swagger" - url: "http://swagger.io" diff --git a/samples/server/petstore/flaskConnexion/.swagger-codegen/VERSION b/samples/server/petstore/flaskConnexion/.swagger-codegen/VERSION index f9f7450d135..855ff9501eb 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 c7c3ee3519a..a216b494a40 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 836d533de5c..11deec4cd1d 100644 --- a/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml +++ b/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml @@ -59,6 +59,7 @@ paths: - "write:pets" - "read:pets" x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-post-method: true put: tags: - "pet" @@ -90,6 +91,7 @@ paths: - "write:pets" - "read:pets" x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-put-method: true /pet/findByStatus: get: tags: @@ -108,11 +110,11 @@ paths: type: "array" items: type: "string" - default: "available" enum: - "available" - "pending" - "sold" + default: "available" collectionFormat: "csv" responses: 200: @@ -128,6 +130,7 @@ paths: - "write:pets" - "read:pets" x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-get-method: true /pet/findByTags: get: tags: @@ -163,6 +166,7 @@ paths: - "read:pets" deprecated: true x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-get-method: true /pet/{petId}: get: tags: @@ -192,6 +196,7 @@ paths: security: - api_key: [] x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-get-method: true post: tags: - "pet" @@ -228,6 +233,7 @@ paths: - "write:pets" - "read:pets" x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-post-method: true delete: tags: - "pet" @@ -256,6 +262,7 @@ paths: - "write:pets" - "read:pets" x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-delete-method: true /pet/{petId}/uploadImage: post: tags: @@ -294,6 +301,7 @@ paths: - "write:pets" - "read:pets" x-swagger-router-controller: "swagger_server.controllers.pet_controller" + x-is-post-method: true /store/inventory: get: tags: @@ -315,6 +323,7 @@ paths: security: - api_key: [] x-swagger-router-controller: "swagger_server.controllers.store_controller" + x-is-get-method: true /store/order: post: tags: @@ -340,6 +349,7 @@ paths: 400: description: "Invalid Order" x-swagger-router-controller: "swagger_server.controllers.store_controller" + x-is-post-method: true /store/order/{orderId}: get: tags: @@ -370,6 +380,7 @@ paths: 404: description: "Order not found" x-swagger-router-controller: "swagger_server.controllers.store_controller" + x-is-get-method: true delete: tags: - "store" @@ -392,6 +403,7 @@ paths: 404: description: "Order not found" x-swagger-router-controller: "swagger_server.controllers.store_controller" + x-is-delete-method: true /user: post: tags: @@ -413,6 +425,7 @@ paths: default: description: "successful operation" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-post-method: true /user/createWithArray: post: tags: @@ -436,6 +449,7 @@ paths: default: description: "successful operation" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-post-method: true /user/createWithList: post: tags: @@ -459,6 +473,7 @@ paths: default: description: "successful operation" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-post-method: true /user/login: get: tags: @@ -483,8 +498,6 @@ paths: responses: 200: description: "successful operation" - schema: - type: "string" headers: X-Rate-Limit: type: "integer" @@ -494,9 +507,12 @@ paths: type: "string" format: "date-time" description: "date in UTC when toekn expires" + schema: + type: "string" 400: description: "Invalid username/password supplied" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-get-method: true /user/logout: get: tags: @@ -512,6 +528,7 @@ paths: default: description: "successful operation" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-get-method: true /user/{username}: get: tags: @@ -525,7 +542,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: @@ -538,6 +555,7 @@ paths: 404: description: "User not found" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-get-method: true put: tags: - "user" @@ -565,6 +583,7 @@ paths: 404: description: "User not found" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-put-method: true delete: tags: - "user" @@ -586,6 +605,7 @@ paths: 404: description: "User not found" x-swagger-router-controller: "swagger_server.controllers.user_controller" + x-is-delete-method: true securityDefinitions: petstore_auth: type: "oauth2" @@ -625,6 +645,8 @@ definitions: type: "boolean" default: false title: "Pet Order" + xml: + name: "Order" description: "An order for a pets from the pet store" example: petId: 6 @@ -633,8 +655,6 @@ definitions: shipDate: "2000-01-23T04:56:07.000+00:00" complete: false status: "placed" - xml: - name: "Order" Category: type: "object" properties: @@ -644,12 +664,12 @@ definitions: name: type: "string" title: "Pet category" + xml: + name: "Category" description: "A category for a pet" example: name: "name" id: 6 - xml: - name: "Category" User: type: "object" properties: @@ -673,6 +693,8 @@ definitions: format: "int32" description: "User Status" title: "a User" + xml: + name: "User" description: "A User who is purchasing from the pet store" example: firstName: "firstName" @@ -683,8 +705,6 @@ definitions: id: 0 email: "email" username: "username" - xml: - name: "User" Tag: type: "object" properties: @@ -694,12 +714,12 @@ definitions: name: type: "string" title: "Pet Tag" + xml: + name: "Tag" description: "A tag for a pet" example: name: "name" id: 1 - xml: - name: "Tag" Pet: type: "object" required: @@ -736,6 +756,8 @@ definitions: - "pending" - "sold" title: "a Pet" + xml: + name: "Pet" description: "A pet for sale in the pet store" example: photoUrls: @@ -752,8 +774,6 @@ definitions: - name: "name" id: 1 status: "available" - xml: - name: "Pet" ApiResponse: type: "object" properties: @@ -770,6 +790,3 @@ definitions: code: 0 type: "type" message: "message" -externalDocs: - description: "Find out more about Swagger" - url: "http://swagger.io"