Overview

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

Version information

Version : 1.0.0

Contact information

Contact : Swagger API Team

License information

License : MIT
Terms of service : http://swagger.io/terms/

URI scheme

Host : petstore.swagger.io
BasePath : /api
Schemes : HTTP

Consumes

  • application/json

Produces

  • application/json

Paths

POST /pets

Description

Creates a new pet in the store. Duplicates are allowed

Parameters

Type Name Description Schema

Body

pet
required

Pet to add to the store

Responses

HTTP Code Description Schema

200

pet response

Pet

default

unexpected error

Produces

  • application/json

GET /pets

Description

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

Parameters

Type Name Description Schema

Query

limit
optional

maximum number of results to return

integer (int32)

Query

tags
optional

tags to filter by

< string > array(csv)

Responses

HTTP Code Description Schema

200

pet response

< Pet > array

default

unexpected error

Produces

  • application/json

  • application/xml

  • text/xml

  • text/html

GET /pets/{id}

Description

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

Parameters

Type Name Description Schema

Path

id
required

ID of pet to fetch

integer (int64)

Responses

HTTP Code Description Schema

200

pet response

Pet

default

unexpected error

Produces

  • application/json

  • application/xml

  • text/xml

  • text/html

DELETE /pets/{id}

Description

deletes a single pet based on the ID supplied

Parameters

Type Name Description Schema

Path

id
required

ID of pet to delete

integer (int64)

Responses

HTTP Code Description Schema

204

pet deleted

No Content

default

unexpected error

Definitions

ErrorModel

Name Schema

code
required

integer (int32)

message
required

string

NewPet

Name Schema

name
required

string

tag
optional

string

Pet

Polymorphism : Composition

Name Schema

id
required

integer (int64)

name
required

string

tag
optional

string