Skip to content

OpenAPI & Swagger Viewer and Validator — YAML or JSON

Paste an OpenAPI 3.x or Swagger 2.0 spec to browse it as docs grouped by tag, check it for structural errors and get a cURL example per endpoint.

OpenAPI 3.0 · Bookstore API 1.2.0 · 4 operations · 1 error, 0 warnings

Validation

  • Error The path uses {itemId} but no in: path parameter named “itemId” is declared.
    at paths./orders/{orderId}/items/{itemId}.get
What is checked

The viewer checks these structural rules from the OpenAPI 3.0 / 3.1 and Swagger 2.0 specifications. This is not a full JSON Schema validation of the document: individual schema keywords (minimum, pattern, format…) are not checked.

  • The document is valid YAML or JSON.
  • It declares openapi: 3.0.x or 3.1.x, or swagger: "2.0".
  • info exists with a title and a version (strings).
  • paths exists (optional in 3.1 when components or webhooks are present).
  • Every path starts with /.
  • Path items contain only HTTP methods, parameters, $ref, summary, description, servers (or x- extensions).
  • Every operation has responses (an error in 2.0 and 3.0, a warning in 3.1).
  • responses is not empty.
  • Response keys are status codes (200), default, or (3.x) ranges such as 2XX.
  • Every response has a description.
  • operationId values are unique.
  • Every {name} in a path has a matching in: path parameter.
  • Every in: path parameter appears in the path.
  • Path parameters have required: true.
  • Every parameter has name and in.
  • in is query, header, path or cookie (2.0: query, header, path, formData or body).
  • No parameter is listed twice with the same name and in.
  • Parameters have a schema or content (2.0: body parameters have a schema, others a type).
  • 2.0: at most one body parameter, and not together with formData.
  • 3.x: requestBody has content.
  • Every local $ref (#/…) points to something that exists.
  • References to other files or URLs are reported (they are not fetched).
  • Security requirements name a defined security scheme.

Documentation: Bookstore API 1.2.0

A small example API. Edit it or paste your own spec.

Base URL: https://api.example-bookstore.com/v1

Books

Browse and manage the catalogue

GET/booksList books
POST/booksAdd a book
GET/books/{bookId}Get one book

Orders

Place and track orders

GET/orders/{orderId}/items/{itemId}Get an order line

Schemas

NewBook
Book
Author
OrderItem

Runs entirely in your browser. Your API spec is never uploaded, and external $refs are not fetched. Browse all free tools.

Found a problem, or something that could be better? We read every message and we fix things quickly.

This OpenAPI viewer and validator reads an OpenAPI 3.0, 3.1 or Swagger 2.0 document in YAML or JSON and shows it as browsable API documentation: every endpoint grouped by tag, with its parameters, request body, responses and schemas, plus a ready-to-run cURL command. Paste the spec or open the file; nothing is uploaded, so internal and unreleased APIs stay private.

The validator runs 23 structural checks taken from the specifications, each listed on the page: info and paths present, responses with descriptions and valid status codes, every {parameter} in a path declared as a required path parameter, unique operationIds, $refs that resolve, and security requirements that name a defined scheme. These are the errors that break code generators and documentation tools. It is not a full validation against the official JSON Schema of the specification, so a spec that passes here can still have, for example, a misspelled schema keyword. External $refs to other files are listed but not fetched.

How to use

  1. Paste your openapi.yaml, openapi.json or swagger.json, or open the file. An example API is loaded to start.
  2. Read the status line and the Validation list. Each problem names the rule and where it is (for example paths./pets/{id}.get).
  3. Browse the documentation: operations are grouped by tag; click one to see parameters, request body, responses and schemas.
  4. Filter by path, summary or operationId to find an endpoint in a large spec.
  5. Copy the cURL example for an operation and replace the <TOKEN> or <API_KEY> placeholder with your credentials.

Frequently asked questions

How do I view a Swagger or OpenAPI file?

Paste the YAML or JSON into the box or open the file. The viewer detects the version (swagger: "2.0" or openapi: 3.0.x / 3.1.x), lists the endpoints grouped by tag and lets you expand each one to see its parameters, request body, responses and resolved schemas. It works offline once the page has loaded.

What does the OpenAPI validator check?

Structural rules from the specification: a supported version field; info with title and version; paths starting with /; operations with non-empty responses that have descriptions and valid status codes; path template parameters declared and required; parameters with name, a valid in and a schema; no duplicate parameters or operationIds; request bodies with content; $refs that resolve; and security requirements that name defined schemes. The full list is on the page under "What is checked". It does not validate every schema keyword against the official JSON Schema.

Why is my undeclared path parameter an error?

The specification requires every {name} in a path template to have a matching parameter with in: path and required: true, at the path or operation level. Some validators that only check the document against the JSON Schema accept a missing one, but code generators then produce a function with no argument for it, and documentation tools show an endpoint you cannot call correctly.

Can it read OpenAPI 3.1 and Swagger 2.0?

Yes. Swagger 2.0 body and formData parameters are shown as a request body, with produces and consumes as media types, so all three versions read the same way. OpenAPI 3.1 differences are respected: paths is optional when components or webhooks are present, responses is optional (a warning here), and type: [string, "null"] is shown as nullable.

Does it load external $ref files?

No. A $ref to another file or URL (for example ./schemas/user.yaml) is listed as a warning and shown as unresolved, because the page cannot read files you have not opened and does not fetch URLs on its own. Bundle a multi-file spec into one document first, for example with redocly bundle or swagger-cli bundle.

Is my API spec uploaded?

No. Parsing, validation and rendering run in your browser. The spec is never sent anywhere.

OpenAPI 3.x and Swagger 2.0: what changed

• Version field: swagger: "2.0" became openapi: 3.0.x, then 3.1.x.

• Servers: 2.0 has host, basePath and schemes; 3.x has a servers list with variables.

• Request bodies: 2.0 uses a parameter with in: body (or formData); 3.x has requestBody with content per media type.

• Reusable parts: 2.0 definitions, parameters and responses at the top level; 3.x puts them under components, alongside securitySchemes, requestBodies and examples.

• 3.1 aligns schemas with JSON Schema 2020-12: type can be a list (["string", "null"] instead of nullable: true), examples is an array, and webhooks are added.

The errors that most often break API tooling

• Path parameters that are not declared, or declared without required: true.

• A $ref with a typo (#/components/schema/User instead of schemas), which leaves part of the docs empty.

• Duplicate operationIds, which make code generators fail or overwrite methods.

• Responses without a description (it is required, even if it is just "OK").

• A security requirement that names a scheme which is not defined, so the generated client has no way to authenticate.