diff --git a/modules/swagger-codegen/src/main/resources/python/api.mustache b/modules/swagger-codegen/src/main/resources/python/api.mustache index 867014d5e128..3fb62cb75eab 100644 --- a/modules/swagger-codegen/src/main/resources/python/api.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api.mustache @@ -47,7 +47,7 @@ class {{classname}}(object): {{{summary}}} {{{notes}}} - {{#allParams}}:param {{dataType}} {{paramName}}: {{{description}}} {{#required}}(required){{/required}}{{#optional}}(optional){{/optional}} + {{#allParams}}:param {{dataType}} {{paramName}}: {{{description}}} {{#required}}(required){{/required}}{{^required}}(optional){{/required}} {{/allParams}} :return: {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}} """ diff --git a/modules/swagger-codegen/src/main/resources/python3/api.mustache b/modules/swagger-codegen/src/main/resources/python3/api.mustache index 015158bccec7..2ff659b11b50 100644 --- a/modules/swagger-codegen/src/main/resources/python3/api.mustache +++ b/modules/swagger-codegen/src/main/resources/python3/api.mustache @@ -36,7 +36,7 @@ class {{classname}}(object): {{{notes}}} Args: - {{#allParams}}{{paramName}}, {{dataType}}: {{{description}}} {{^optional}}(required){{/optional}}{{#optional}}(optional){{/optional}} + {{#allParams}}{{paramName}}, {{dataType}}: {{{description}}} {{#required}}(required){{/required}}{{^required}}(optional){{/required}} {{/allParams}} Returns: {{returnType}} diff --git a/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/pet_api.py b/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/pet_api.py index 5f5c2fe81fa3..7f022930869a 100644 --- a/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/pet_api.py +++ b/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/pet_api.py @@ -46,7 +46,7 @@ class PetApi(object): Update an existing pet - :param Pet body: Pet object that needs to be added to the store + :param Pet body: Pet object that needs to be added to the store (optional) :return: None """ @@ -97,7 +97,7 @@ class PetApi(object): Add a new pet to the store - :param Pet body: Pet object that needs to be added to the store + :param Pet body: Pet object that needs to be added to the store (optional) :return: None """ @@ -148,7 +148,7 @@ class PetApi(object): Finds Pets by status Multiple status values can be provided with comma seperated strings - :param list[str] status: Status values that need to be considered for filter + :param list[str] status: Status values that need to be considered for filter (optional) :return: list[Pet] """ @@ -201,7 +201,7 @@ class PetApi(object): Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - :param list[str] tags: Tags to filter by + :param list[str] tags: Tags to filter by (optional) :return: list[Pet] """ @@ -312,8 +312,8 @@ class PetApi(object): :param str 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 + :param str name: Updated name of the pet (optional) + :param str status: Updated status of the pet (optional) :return: None """ @@ -374,7 +374,7 @@ class PetApi(object): Deletes a pet - :param str api_key: + :param str api_key: (optional) :param int pet_id: Pet id to delete (required) :return: None @@ -434,8 +434,8 @@ class PetApi(object): :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 + :param str additional_metadata: Additional data to pass to server (optional) + :param File file: file to upload (optional) :return: None """ diff --git a/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/store_api.py b/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/store_api.py index 1e024cfbb5b8..f017df791d9a 100644 --- a/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/store_api.py +++ b/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/store_api.py @@ -95,7 +95,7 @@ class StoreApi(object): Place an order for a pet - :param Order body: order placed for purchasing the pet + :param Order body: order placed for purchasing the pet (optional) :return: Order """ diff --git a/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/user_api.py b/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/user_api.py index 84a40b06579e..177c5e3a565f 100644 --- a/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/user_api.py +++ b/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/user_api.py @@ -46,7 +46,7 @@ class UserApi(object): Create user This can only be done by the logged in user. - :param User body: Created user object + :param User body: Created user object (optional) :return: None """ @@ -97,7 +97,7 @@ class UserApi(object): Creates list of users with given input array - :param list[User] body: List of user object + :param list[User] body: List of user object (optional) :return: None """ @@ -148,7 +148,7 @@ class UserApi(object): Creates list of users with given input array - :param list[User] body: List of user object + :param list[User] body: List of user object (optional) :return: None """ @@ -199,8 +199,8 @@ class UserApi(object): Logs user into the system - :param str username: The user name for login - :param str password: The password for login in clear text + :param str username: The user name for login (optional) + :param str password: The password for login in clear text (optional) :return: str """ @@ -361,7 +361,7 @@ class UserApi(object): This can only be done by the logged in user. :param str username: name that need to be deleted (required) - :param User body: Updated user object + :param User body: Updated user object (optional) :return: None """ diff --git a/samples/client/petstore/python3/client/pet_api.py b/samples/client/petstore/python3/client/pet_api.py index 9293a89d2b04..cebab131778f 100644 --- a/samples/client/petstore/python3/client/pet_api.py +++ b/samples/client/petstore/python3/client/pet_api.py @@ -35,7 +35,7 @@ class PetApi(object): Args: - body, Pet: Pet object that needs to be added to the store (required) + body, Pet: Pet object that needs to be added to the store (optional) Returns: @@ -77,7 +77,7 @@ class PetApi(object): Args: - body, Pet: Pet object that needs to be added to the store (required) + body, Pet: Pet object that needs to be added to the store (optional) Returns: @@ -119,7 +119,7 @@ class PetApi(object): Multiple status values can be provided with comma seperated strings Args: - status, list[str]: Status values that need to be considered for filter (required) + status, list[str]: Status values that need to be considered for filter (optional) Returns: list[Pet] @@ -170,7 +170,7 @@ class PetApi(object): Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. Args: - tags, list[str]: Tags to filter by (required) + tags, list[str]: Tags to filter by (optional) Returns: list[Pet] @@ -275,8 +275,8 @@ class PetApi(object): Args: pet_id, str: ID of pet that needs to be updated (required) - name, str: Updated name of the pet (required) - status, str: Updated status of the pet (required) + name, str: Updated name of the pet (optional) + status, str: Updated status of the pet (optional) Returns: @@ -323,7 +323,7 @@ class PetApi(object): Args: - api_key, str: (required) + api_key, str: (optional) pet_id, int: Pet id to delete (required) @@ -375,8 +375,8 @@ class PetApi(object): Args: pet_id, int: ID of pet to update (required) - additional_metadata, str: Additional data to pass to server (required) - file, file: file to upload (required) + additional_metadata, str: Additional data to pass to server (optional) + file, file: file to upload (optional) Returns: diff --git a/samples/client/petstore/python3/client/store_api.py b/samples/client/petstore/python3/client/store_api.py index 8002b473f8ae..802e116f1ff1 100644 --- a/samples/client/petstore/python3/client/store_api.py +++ b/samples/client/petstore/python3/client/store_api.py @@ -82,7 +82,7 @@ class StoreApi(object): Args: - body, Order: order placed for purchasing the pet (required) + body, Order: order placed for purchasing the pet (optional) Returns: Order diff --git a/samples/client/petstore/python3/client/user_api.py b/samples/client/petstore/python3/client/user_api.py index c4c3c2ede52a..54813ca2dddd 100644 --- a/samples/client/petstore/python3/client/user_api.py +++ b/samples/client/petstore/python3/client/user_api.py @@ -35,7 +35,7 @@ class UserApi(object): This can only be done by the logged in user. Args: - body, User: Created user object (required) + body, User: Created user object (optional) Returns: @@ -77,7 +77,7 @@ class UserApi(object): Args: - body, list[User]: List of user object (required) + body, list[User]: List of user object (optional) Returns: @@ -119,7 +119,7 @@ class UserApi(object): Args: - body, list[User]: List of user object (required) + body, list[User]: List of user object (optional) Returns: @@ -161,8 +161,8 @@ class UserApi(object): Args: - username, str: The user name for login (required) - password, str: The password for login in clear text (required) + username, str: The user name for login (optional) + password, str: The password for login in clear text (optional) Returns: str @@ -311,7 +311,7 @@ class UserApi(object): Args: username, str: name that need to be deleted (required) - body, User: Updated user object (required) + body, User: Updated user object (optional) Returns: