Petstore Swagger v2.0 API Wiki

This wiki is provided as a writing sample.

Introduction

The Petstore Swagger API is a sample API which allows developers, technical writers, and other interested parties to explore the Swagger OpenAPI Specification (OAS).

This wiki will cover the following topics in regards to interacting with the Petstore API, based on Swagger (OpenAPI) version 2.0.

NOTE: The Petstore API is intended to be an interactive example of an implementation of OpenAPI v2.0. As such, it is not fully fleshed out in terms of business logic or functionality. Several suggestions may be offered in the User Manual about displaying results to the user, or implementing business logic that does not currently exist within the API.

Index

 

Resources

The following resources are documented in this wiki:

The Petstore API offers the following resources:

Pet

The Pet resource allows manipulation of Pets in the store. This includes adding inventory, updating inventory, adding images, and searches by status or by ID.

Resource – /pet
Method Endpoint Description
POST /pet Adds a new Pet to the store.
POST /pet/{petId} Updates an existing Pet in the store with form data.
POST /pet/{petId}/uploadImage Uploads an image for an existing Pet.
PUT /pet Updates an existing Pet in the store.
GET /pet/findByStatus Finds a list of Pets by Status.
GET /pet/{petId} Finds a Pet by ID.
DELETE /pet/{petId} Deletes a Pet from the store.

 

Store

The Store resource allows for the manipulation of the store. The capabilities include retrieving an inventory, and creating, finding, and deleting a Purchase Order.

Resource – /store
Method Endpoint Description
POST /store/order Places a Purchase Order for a Pet.
GET /store/inventory Retrieves the Pet Inventory from the store by status.
GET /store/order/{orderId} Finds a Purchase Order by ID to check the status.
DELETE /store/order/{orderId} Deletes an Purchase Order by ID.

 

User

The User resource allows for the creation and manipulation of users. This includes creating a single or group of users, logging on or logging out of the system, and updating or deleting user profiles.

Resource – /user
Method Endpoint Description
POST /user Creates a single user.
POST /user/createWithArray Creates a list of users from a provided array.
POST /user/createWithList Creates a list of users from a provided array.
GET /user/login  Logs a user into the system.
GET /user/logout  Logs out the currently logged in user session.
GET /user/{username}  Gets user by username.
PUT /user/{username}  Updates a user by username.
DELETE /user/{username}  Deletes a user by username.

 

User Manual

The following tutorials will guide a developer through some basic steps and workflows.

Workflows

 

References

 

Index