Swagger Viewer & Editor
Specification
Format
Specification codepaste a Swagger 2.0 / OpenAPI 3.x document (YAML or JSON)
Valid document — changes are saved in your browser.

Swagger Petstore

Swagger 2.0v1.0.7

This is a sample Petstore server. You can find out more about Swagger at [swagger.io](http://swagger.io).

Server

pet

5

Everything about your Pets

put/petUpdate an existing pet
post/petAdd a new pet to the store
get/pet/findByStatusFinds Pets by status
get/pet/{petId}Find pet by ID
delete/pet/{petId}Deletes a pet

store

3

Access to Petstore orders

get/store/inventoryReturns pet inventories by status
post/store/orderPlace an order for a pet
get/store/order/{orderId}Find purchase order by ID

user

3

Operations about user

post/userCreate user
get/user/loginLogs user into the system
get/user/{username}Get user by user name

Schemas

6

Online Swagger Editor and OpenAPI Viewer with API Testing

View, edit and test Swagger and OpenAPI specifications directly in the browser. Paste a document in YAML or JSON, browse the rendered documentation, convert between Swagger 2.0, OpenAPI 3.0 and OpenAPI 3.1, send real requests to each endpoint and export the result as YAML, JSON or a standalone HTML documentation page.

The tool combines a code editor, a visual documentation browser and an HTTP request console in a single split view: the specification code on the left always reflects the visual edits made on the right.

Swagger Viewer & Editor

Work with Swagger 2.0, OpenAPI 3.0 and OpenAPI 3.1 documents in YAML or JSON. The classic Petstore example is loaded on first use, and any document you paste is kept in your browser's local storage — nothing is sent to our servers.

How to use

Paste your specification into the code panel on the left. The document is validated as you type; when it is valid, the rendered documentation appears on the right, grouped by tag, with parameters, request bodies, responses and schemas. Use the Format switch to convert the code between YAML and JSON, and the Specification selector to convert the document to another Swagger/OpenAPI version. Use the Petstore button to restore the classic example at any time.

Editing with + and −

Unlike a regular viewer, the documentation panel is editable: use the + buttons to add endpoints, parameters, request bodies, responses, schemas and schema properties, and the buttons to remove them. Every visual change is immediately reflected in the specification code on the left, in the current format and version. For fine-grained edits (descriptions, examples, security), edit the code directly — the preview updates as you type.

Version conversion

The version selector converts the whole document: host/basePath become servers, body parameters become requestBody, definitions become components/schemas and all $ref references are rewritten — and vice versa when downgrading. Conversion is a best-effort adaptation: features without an equivalent in the target version (for example HTTP bearer security in Swagger 2.0) are approximated, so review the result for advanced documents.

Testing endpoints

Expand an operation, fill in the parameter values and request body, choose the target server (or type a custom base URL) and click Execute. The request is sent from your browser and the status code, response time and response body are shown below the operation. Because requests come from the browser, the target API must allow cross-origin requests (CORS); the default Petstore server does.

Downloads and standalone HTML

Download the specification as YAML or JSON, or export a standalone HTML page: a single self-contained file with the full read-only documentation and the request console, which anyone can open in a browser without installing anything — ideal for sharing API documentation with your team.

Privacy

Parsing, conversion and rendering run entirely in your browser. The specification is stored only in your browser's local storage, and requests made with Execute go straight from your browser to the API server you chose.