Swagger Petstore (1.0.0)

Download OpenAPI specification:Download

A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification

findPets

Returns all pets from the system that the user has access to

query Parameters
tags
Array of strings

tags to filter by

limit
integer <int32>

maximum number of results to return

Responses

200

pet response

default

unexpected error

get /pets
http://petstore.swagger.io/api/pets

Response samples

Copy
Expand all Collapse all
[
  • {
    }
]

addPet

Creates a new pet in the store. Duplicates are allowed

Request Body schema: application/json

Pet to add to the store

name
required
string
tag
string

Responses

200

pet response

default

unexpected error

post /pets
http://petstore.swagger.io/api/pets

Request samples

application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "tag": "string"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "tag": "string",
  • "id": 0
}

findPetById

Returns a user based on a single ID, if the user does not have access to the pet

path Parameters
id
required
integer <int64>

ID of pet to fetch

Responses

200

pet response

default

unexpected error

get /pets/{id}
http://petstore.swagger.io/api/pets/{id}

Response samples

Copy
Expand all Collapse all
{
  • "name": "string",
  • "tag": "string",
  • "id": 0
}

deletePet

deletes a single pet based on the ID supplied

path Parameters
id
required
integer <int64>

ID of pet to delete

Responses

204

pet deleted

default

unexpected error

delete /pets/{id}
http://petstore.swagger.io/api/pets/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "string"
}