Javier Velilla 3067da2877 Swagger eiffel:fix (#6674)
* Updated api client, Required parameters {{#required}} .. {{/required}}, are mapped to Eiffel
Void Safety Rules, optional parameters are translated to detachable TYPE.
Validation Rules are mapped to preconditions, at the moment maximun and minimun
validation has been added.
Improved API_CLIENT.parameter_to_tuple feature to accept a LIST [ANY] instead of LIST [STRING_32].
Improved model template to generate the model output.

* Updated API_CLIENT.parameter_to_string feature, missing STRING representation.

* Updating sample using the latest modifications.
2017-10-16 11:02:19 +08:00

6.9 KiB

PET_API

All URIs are relative to http://petstore.swagger.io/v2

Feature HTTP request Description
add_pet Post /pet Add a new pet to the store
delete_pet Delete /pet/{petId} Deletes a pet
find_pets_by_status Get /pet/findByStatus Finds Pets by status
find_pets_by_tags Get /pet/findByTags Finds Pets by tags
pet_by_id Get /pet/{petId} Find pet by ID
update_pet Put /pet Update an existing pet
update_pet_with_form Post /pet/{petId} Updates a pet in the store with form data
upload_file Post /pet/{petId}/uploadImage uploads an image

add_pet

add_pet (body: PET )

Add a new pet to the store

Parameters

Name Type Description Notes
body PET Pet object that needs to be added to the store

Return type

{empty response body)

Authorization

petstore_auth

HTTP request headers

  • Content-Type: application/json, application/xml
  • Accept: application/xml, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_pet

delete_pet (pet_id: INTEGER_64 ; api_key: detachable STRING_32 )

Deletes a pet

Parameters

Name Type Description Notes
pet_id INTEGER_64 Pet id to delete
api_key STRING_32 [optional]

Return type

{empty response body)

Authorization

petstore_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

find_pets_by_status

find_pets_by_status (status: LIST [STRING_32] ): detachable LIST [PET]

Finds Pets by status

Multiple status values can be provided with comma separated strings

Parameters

Name Type Description Notes
status LIST [STRING_32] Status values that need to be considered for filter

Return type

LIST [PET]

Authorization

petstore_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

find_pets_by_tags

find_pets_by_tags (tags: LIST [STRING_32] ): detachable LIST [PET]

Finds Pets by tags

Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

Parameters

Name Type Description Notes
tags LIST [STRING_32] Tags to filter by

Return type

LIST [PET]

Authorization

petstore_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pet_by_id

pet_by_id (pet_id: INTEGER_64 ): detachable PET

Find pet by ID

Returns a single pet

Parameters

Name Type Description Notes
pet_id INTEGER_64 ID of pet to return

Return type

PET

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_pet

update_pet (body: PET )

Update an existing pet

Parameters

Name Type Description Notes
body PET Pet object that needs to be added to the store

Return type

{empty response body)

Authorization

petstore_auth

HTTP request headers

  • Content-Type: application/json, application/xml
  • Accept: application/xml, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_pet_with_form

update_pet_with_form (pet_id: INTEGER_64 ; name: detachable STRING_32 ; status: detachable STRING_32 )

Updates a pet in the store with form data

Parameters

Name Type Description Notes
pet_id INTEGER_64 ID of pet that needs to be updated
name STRING_32 Updated name of the pet [optional]
status STRING_32 Updated status of the pet [optional]

Return type

{empty response body)

Authorization

petstore_auth

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/xml, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

upload_file

upload_file (pet_id: INTEGER_64 ; additional_metadata: detachable STRING_32 ; file: detachable FILE ): detachable API_RESPONSE

uploads an image

Parameters

Name Type Description Notes
pet_id INTEGER_64 ID of pet to update
additional_metadata STRING_32 Additional data to pass to server [optional]
file FILE file to upload [optional]

Return type

API_RESPONSE

Authorization

petstore_auth

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]