1. Overview

Petstore API Description

1.1. Version information

Version : 1.0.0

1.2. Contact information

Contact : TestName
Contact Email : test@test.de

1.3. License information

License : Apache 2.0
License URL : http://www.apache.org/licenses/LICENSE-2.0.html

1.4. URI scheme

Host : localhost:8080
BasePath : /

1.5. Tags

  • Stores : Operations about store

  • Users : Operations about user

  • Pets : Operations about pets

2. Chapter of manual content 1

This is some dummy text

2.1. Sub chapter

Dummy text of sub chapter

3. Chapter of manual content 2

This is some dummy text

4. Resources

4.1. Pets

Operations about pets

4.1.1. Add a new pet to the store

POST /pets
Parameters
Type Name Description Schema

Body

pet
required

Pet object that needs to be added to the store

Pet

Responses
HTTP Code Description Schema

200

OK

string

201

Created

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

405

Invalid input

No Content

Consumes
  • application/json

Produces
  • application/xml

  • application/x-smile

  • application/json

Example HTTP request
POST /pets/ HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080
Content-Length: 96

{"id":1,"category":{"id":1,"name":"Hund"},"name":"Wuffy","photoUrls":[],"tags":[],"status":null}
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 7

SUCCESS
Example Curl request
$ curl 'http://localhost:8080/pets/' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '{"id":1,"category":{"id":1,"name":"Hund"},"name":"Wuffy","photoUrls":[],"tags":[],"status":null}'

4.1.2. Update an existing pet

PUT /pets
Parameters
Type Name Description Schema

Body

pet
required

Pet object that needs to be added to the store

Pet

Responses
HTTP Code Description Schema

200

OK

string

201

Created

No Content

400

Invalid ID supplied

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Pet not found

No Content

405

Validation exception

No Content

Consumes
  • application/json

Produces
  • application/xml

  • application/x-smile

  • application/json

Security
Type Name Scopes

oauth2

petstore_auth

write_pets,read_pets

4.1.3. Finds Pets by status

GET /pets/findByStatus
Description

Multiple status values can be provided with comma seperated strings

Parameters
Type Name Description Schema Default

Query

status
required

Status values that need to be considered for filter

enum (available, pending, sold)

"available"

Responses
HTTP Code Description Schema

200

OK

< Pet > array

400

Invalid status value

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes
  • application/json

Produces
  • application/xml

  • application/x-smile

  • application/json

Security
Type Name Scopes

oauth2

petstore_auth

write_pets,read_pets

Caution

This operation is deprecated.

4.1.4. Finds Pets by tags

GET /pets/findByTags
Description

Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.

Parameters
Type Name Description Schema

Query

tags
required

Tags to filter by

string

Responses
HTTP Code Description Schema

200

OK

< Pet > array

400

Invalid tag value

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes
  • application/json

Produces
  • application/xml

  • application/x-smile

  • application/json

Security
Type Name Scopes

oauth2

petstore_auth

write_pets,read_pets

4.1.5. Find pet by ID

GET /pets/{petId}
Description

Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions

Parameters
Type Name Description Schema

Path

petId
required

ID of pet that needs to be fetched

string

Responses
HTTP Code Description Schema

200

OK

Pet

400

Invalid ID supplied

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Pet not found

No Content

Consumes
  • application/json

Produces
  • application/xml

  • application/x-smile

  • application/json

Security
Type Name Scopes

apiKey

api_key

oauth2

petstore_auth

write_pets,read_pets

4.2. Stores

Operations about store

4.2.1. Place an order for a pet

POST /stores/order
Parameters
Type Name Description Schema

Body

order
required

order placed for purchasing the pet

Order

Responses
HTTP Code Description Schema

200

OK

Order

201

Created

No Content

400

Invalid Order

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes
  • application/json

Produces
  • application/json

4.2.2. Find purchase order by ID

GET /stores/order/{orderId}
Description

For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions

Parameters
Type Name Description Schema

Path

orderId
required

ID of pet that needs to be fetched

string

Responses
HTTP Code Description Schema

200

OK

Order

400

Invalid ID supplied

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Order not found

No Content

Consumes
  • application/json

Produces
  • application/json

4.2.3. Delete purchase order by ID

DELETE /stores/order/{orderId}
Description

For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors

Parameters
Type Name Description Schema

Path

orderId
required

ID of the order that needs to be deleted

string

Responses
HTTP Code Description Schema

200

OK

string

204

No Content

No Content

400

Invalid ID supplied

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Order not found

No Content

Consumes
  • application/json

Produces
  • application/json

4.3. Users

Operations about user

4.3.1. Create user

POST /users
Description

This can only be done by the logged in user.

Parameters
Type Name Description Schema

Body

user
required

Created user object

User

Responses
HTTP Code Description Schema

200

OK

User

201

Created

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes
  • application/json

Produces
  • application/json

4.3.2. Creates list of users with given input array

POST /users/createWithArray
Parameters
Type Name Description Schema

Body

users
required

List of user object

< User > array

Responses
HTTP Code Description Schema

200

OK

User

201

Created

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes
  • application/json

Produces
  • application/json

4.3.3. Creates list of users with given input array

POST /users/createWithList
Parameters
Type Name Description Schema

Body

users
required

List of user object

< User > array

Responses
HTTP Code Description Schema

200

OK

string

201

Created

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes
  • application/json

Produces
  • application/json

4.3.4. Logs user into the system

GET /users/login
Parameters
Type Name Description Schema

Query

password
required

The password for login in clear text

string

Query

username
required

The user name for login

string

Responses
HTTP Code Description Schema

200

OK

string

400

Invalid username/password supplied

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes
  • application/json

Produces
  • application/json

4.3.5. Logs out current logged in user session

GET /users/logout
Responses
HTTP Code Description Schema

200

OK

string

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes
  • application/json

Produces
  • application/json

4.3.6. Get user by user name

GET /users/{username}
Parameters
Type Name Description Schema

Path

username
required

The name that needs to be fetched. Use user1 for testing.

string

Responses
HTTP Code Description Schema

200

OK

User

400

Invalid username supplied

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

User not found

No Content

Consumes
  • application/json

Produces
  • application/json

4.3.7. Updated user

PUT /users/{username}
Description

This can only be done by the logged in user.

Parameters
Type Name Description Schema

Path

username
required

name that need to be deleted

string

Body

user
required

Updated user object

User

Responses
HTTP Code Description Schema

200

OK

string

201

Created

No Content

400

Invalid user supplied

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

User not found

No Content

Consumes
  • application/json

Produces
  • application/json

4.3.8. Delete user

DELETE /users/{username}
Description

This can only be done by the logged in user.

Parameters
Type Name Description Schema

Path

username
required

The name that needs to be deleted

string

Responses
HTTP Code Description Schema

200

OK

string

204

No Content

No Content

400

Invalid username supplied

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

User not found

No Content

Consumes
  • application/json

Produces
  • application/json

5. Security

5.1. petstore_auth

Type : oauth2
Flow : implicit
Token URL : http://petstore.swagger.io/api/oauth/dialog

Name Description

write_pets

modify pets in your account

read_pets

read your pets

5.2. api_key

Type : apiKey
Name : api_key
In : HEADER

6. Definitions

6.1. Category

Name Description Schema

id
optional

integer(int64)

name
optional

Length : 1 - 100

string

6.2. Order

Name Description Schema

complete
optional

boolean

id
optional

integer(int64)

petId
optional

integer(int64)

quantity
optional

Minimum value : 1
Maximum value : 100

integer(int32)

shipDate
optional

string(date-time)

status
optional

Order Status

enum (placed, approved, delivered)

6.3. Pet

Name Description Schema

category
optional

Category

id
optional

integer(int64)

name
optional

Length : 1 - 100

string

photoUrls
optional

< string > array

status
optional

pet status in the store

enum (available, pending, sold)

tags
optional

< Tag > array

6.4. Tag

Name Description Schema

id
optional

integer(int64)

name
optional

Length : 1 - 100

string

6.5. User

Name Description Schema

email
optional

string

firstName
optional

Length : 1 - 200

string

id
optional

integer(int64)

lastName
optional

Length : 1 - 200

string

password
optional

string

phone
optional

string

userStatus
optional

User Status

integer(int32)

username
optional

Length : 1 - 100

string