Swagger Petstore
Describe APIs in Pet Store
pet
Description for pet tag
addPet
Add a new pet to the store
Request
POST /pet
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *body | body |
|
Pet object that needs to be added to the store |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 405 | Invalid input |
updatePet
Update an existing pet
Request
PUT /pet
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *body | body |
|
Pet object that needs to be added to the store |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 400 | Invalid ID supplied |
||
| 404 | Pet not found |
||
| 405 | Validation exception |
findPetsByStatus
Finds Pets by status
Multiple status values can be provided with comma separated strings
Request
GET /pet/findByStatus?status
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *status | query | Status values that need to be considered for filter |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 200 |
|
successful operation |
|
| 400 | Invalid status value |
findPetsByTags
Finds Pets by tags
Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Request
GET /pet/findByTags?tags
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *tags | query | Tags to filter by |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 200 |
|
successful operation |
|
| 400 | Invalid tag value |
deletePet
Deletes a pet
Request
DELETE /pet/{petId}
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| api_key | header | |||
| *petId | path | Pet id to delete |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 400 | Invalid ID supplied |
||
| 404 | Pet not found |
getPetById
Find pet by ID
Returns a single pet
Request
GET /pet/{petId}
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *petId | path | ID of pet to return |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 200 |
|
successful operation |
|
| 400 | Invalid ID supplied |
||
| 404 | Pet not found |
updatePetWithForm
Updates a pet in the store with form data
Request
POST /pet/{petId}
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *petId | path | ID of pet that needs to be updated |
||
| name | formData | Updated name of the pet |
||
| status | formData | Updated status of the pet |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 405 | Invalid input |
uploadFile
uploads an image
Request
POST /pet/{petId}/uploadImage
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *petId | path | ID of pet to update |
||
| additionalMetadata | formData | Additional data to pass to server |
||
| file | formData | file to upload |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 200 |
|
successful operation |
store
Access to Petstore orders
Additional description for store tag
addPet
Add a new pet to the store
Request
POST /pet
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *body | body |
|
Pet object that needs to be added to the store |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 405 | Invalid input |
getInventory
Returns pet inventories by status
Returns a map of status codes to quantities
Request
GET /store/inventory
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 200 | object | successful operation |
placeOrder
Place an order for a pet
Request
POST /store/order
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *body | body |
|
order placed for purchasing the pet |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 200 |
|
successful operation |
|
| 400 | Invalid Order |
deleteOrder
Delete purchase order by ID
For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
Request
DELETE /store/order/{orderId}
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *orderId | path | ID of the order that needs to be deleted |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 400 | Invalid ID supplied |
||
| 404 | Order not found |
getOrderById
Find purchase order by ID
For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
Request
GET /store/order/{orderId}
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *orderId | path | ID of pet that needs to be fetched |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 200 |
|
successful operation |
|
| 400 | Invalid ID supplied |
||
| 404 | Order not found |
user
Operations about user
createUser
Create user
This can only be done by the logged in user.
Request
POST /user
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *body | body |
|
Created user object |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| default | successful operation |
createUsersWithArrayInput
Creates list of users with given input array
Request
POST /user/createWithArray
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *body | body |
|
List of user object |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| default | successful operation |
createUsersWithListInput
Creates list of users with given input array
Request
POST /user/createWithList
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *body | body |
|
List of user object |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| default | successful operation |
loginUser
Logs user into the system
Request
GET /user/login?username&password
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *username | query | The user name for login |
||
| *password | query | The password for login in clear text |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 200 | string | successful operation |
|
| 400 | Invalid username/password supplied |
logoutUser
Logs out current logged in user session
Request
GET /user/logout
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| default | successful operation |
deleteUser
Delete user
This can only be done by the logged in user.
Request
DELETE /user/{username}
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *username | path | The name that needs to be deleted |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 400 | Invalid username supplied |
||
| 404 | User not found |
getUserByName
Get user by user name
Request
GET /user/{username}
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *username | path | The name that needs to be fetched. Use user1 for testing. |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 200 |
|
successful operation |
|
| 400 | Invalid username supplied |
||
| 404 | User not found |
Other APIs
| Improve this Doc View SourceupdateUser
Updated user
This can only be done by the logged in user.
Request
PUT /user/{username}
Parameters
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| *username | path | name that need to be updated |
||
| *body | body |
|
Updated user object |
Responses
| Status Code | Type | Description | Samples |
|---|---|---|---|
| 400 | Invalid user supplied |
||
| 404 | User not found |
Definitions
Pet
| Name | Type | Notes |
|---|---|---|
| category |
|
|
| id | integer (int64) | |
| name | string | |
| photoUrls | array | |
| status | string | pet status in the store |
| tags |
|
Category
| Name | Type | Notes |
|---|---|---|
| id | integer (int64) | |
| name | string |
Tag
| Name | Type | Notes |
|---|---|---|
| id | integer (int64) | |
| name | string |
ApiResponse
| Name | Type | Notes |
|---|---|---|
| code | integer (int32) | |
| message | string | |
| type | string |
Order
| Name | Type | Notes |
|---|---|---|
| complete | boolean | |
| id | integer (int64) | |
| petId | integer (int64) | |
| quantity | integer (int32) | |
| shipDate | string (date-time) | |
| status | string | Order Status |
User
| Name | Type | Notes |
|---|---|---|
| string | ||
| firstName | string | |
| id | integer (int64) | |
| lastName | string | |
| password | string | |
| phone | string | |
| userStatus | integer (int32) | User Status |
| username | string |