Update Python flask default value (#361)

* update python flask default value

* update python flask samples
This commit is contained in:
William Cheng
2018-05-08 10:16:25 +08:00
committed by GitHub
parent 14c241fbce
commit 3758aad225
61 changed files with 1100 additions and 1079 deletions

View File

@@ -0,0 +1,124 @@
import connexion
import six
from openapi_server.models.api_response import ApiResponse # noqa: E501
from openapi_server.models.pet import Pet # noqa: E501
from openapi_server import util
def add_pet(pet): # noqa: E501
"""Add a new pet to the store
# noqa: E501
:param pet: Pet object that needs to be added to the store
:type pet: dict | bytes
:rtype: None
"""
if connexion.request.is_json:
pet = Pet.from_dict(connexion.request.get_json()) # noqa: E501
return 'do some magic!'
def delete_pet(pet_id, api_key=None): # noqa: E501
"""Deletes a pet
# noqa: E501
:param pet_id: Pet id to delete
:type pet_id: int
:param api_key:
:type api_key: str
:rtype: None
"""
return 'do some magic!'
def find_pets_by_status(status): # noqa: E501
"""Finds Pets by status
Multiple status values can be provided with comma separated strings # noqa: E501
:param status: Status values that need to be considered for filter
:type status: List[str]
:rtype: List[Pet]
"""
return 'do some magic!'
def find_pets_by_tags(tags): # noqa: E501
"""Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
:param tags: Tags to filter by
:type tags: List[str]
:rtype: List[Pet]
"""
return 'do some magic!'
def get_pet_by_id(pet_id): # noqa: E501
"""Find pet by ID
Returns a single pet # noqa: E501
:param pet_id: ID of pet to return
:type pet_id: int
:rtype: Pet
"""
return 'do some magic!'
def update_pet(pet): # noqa: E501
"""Update an existing pet
# noqa: E501
:param pet: Pet object that needs to be added to the store
:type pet: dict | bytes
:rtype: None
"""
if connexion.request.is_json:
pet = Pet.from_dict(connexion.request.get_json()) # noqa: E501
return 'do some magic!'
def update_pet_with_form(pet_id, name=None, status=None): # noqa: E501
"""Updates a pet in the store with form data
# noqa: E501
:param pet_id: ID of pet that needs to be updated
:type pet_id: int
:param name: Updated name of the pet
:type name: str
:param status: Updated status of the pet
:type status: str
:rtype: None
"""
return 'do some magic!'
def upload_file(pet_id, additional_metadata=None, file=None): # noqa: E501
"""uploads an image
# noqa: E501
:param pet_id: ID of pet to update
:type pet_id: int
:param additional_metadata: Additional data to pass to server
:type additional_metadata: str
:param file: file to upload
:type file: str
:rtype: ApiResponse
"""
return 'do some magic!'

View File

@@ -0,0 +1,57 @@
import connexion
import six
from openapi_server.models.order import Order # noqa: E501
from openapi_server import util
def delete_order(order_id): # noqa: E501
"""Delete purchase order by ID
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
:param order_id: ID of the order that needs to be deleted
:type order_id: str
:rtype: None
"""
return 'do some magic!'
def get_inventory(): # noqa: E501
"""Returns pet inventories by status
Returns a map of status codes to quantities # noqa: E501
:rtype: Dict[str, int]
"""
return 'do some magic!'
def get_order_by_id(order_id): # noqa: E501
"""Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501
:param order_id: ID of pet that needs to be fetched
:type order_id: int
:rtype: Order
"""
return 'do some magic!'
def place_order(order): # noqa: E501
"""Place an order for a pet
# noqa: E501
:param order: order placed for purchasing the pet
:type order: dict | bytes
:rtype: Order
"""
if connexion.request.is_json:
order = Order.from_dict(connexion.request.get_json()) # noqa: E501
return 'do some magic!'

View File

@@ -0,0 +1,119 @@
import connexion
import six
from openapi_server.models.user import User # noqa: E501
from openapi_server import util
def create_user(user): # noqa: E501
"""Create user
This can only be done by the logged in user. # noqa: E501
:param user: Created user object
:type user: dict | bytes
:rtype: None
"""
if connexion.request.is_json:
user = User.from_dict(connexion.request.get_json()) # noqa: E501
return 'do some magic!'
def create_users_with_array_input(user): # noqa: E501
"""Creates list of users with given input array
# noqa: E501
:param user: List of user object
:type user: list | bytes
:rtype: None
"""
if connexion.request.is_json:
user = [User.from_dict(d) for d in connexion.request.get_json()] # noqa: E501
return 'do some magic!'
def create_users_with_list_input(user): # noqa: E501
"""Creates list of users with given input array
# noqa: E501
:param user: List of user object
:type user: list | bytes
:rtype: None
"""
if connexion.request.is_json:
user = [User.from_dict(d) for d in connexion.request.get_json()] # noqa: E501
return 'do some magic!'
def delete_user(username): # noqa: E501
"""Delete user
This can only be done by the logged in user. # noqa: E501
:param username: The name that needs to be deleted
:type username: str
:rtype: None
"""
return 'do some magic!'
def get_user_by_name(username): # noqa: E501
"""Get user by user name
# noqa: E501
:param username: The name that needs to be fetched. Use user1 for testing.
:type username: str
:rtype: User
"""
return 'do some magic!'
def login_user(username, password): # noqa: E501
"""Logs user into the system
# noqa: E501
:param username: The user name for login
:type username: str
:param password: The password for login in clear text
:type password: str
:rtype: str
"""
return 'do some magic!'
def logout_user(): # noqa: E501
"""Logs out current logged in user session
# noqa: E501
:rtype: None
"""
return 'do some magic!'
def update_user(username, user): # noqa: E501
"""Updated user
This can only be done by the logged in user. # noqa: E501
:param username: name that need to be deleted
:type username: str
:param user: Updated user object
:type user: dict | bytes
:rtype: None
"""
if connexion.request.is_json:
user = User.from_dict(connexion.request.get_json()) # noqa: E501
return 'do some magic!'