Codepackr / validators / OpenAPI / Swagger Spec Viewer

OpenAPI / Swagger Spec Viewer

Validate, parse, and inspect structural syntax and endpoint routes for OpenAPI 3.0 and Swagger API specifications.

Client-Side Execution & Privacy Guarantee

This utility executes 100% locally in your web browser. Your inputs, tokens, queries, and data payloads are never transmitted to any external server or backend.

OpenAPI (formerly Swagger) specifications describe REST APIs in a machine-readable YAML or JSON document. The OpenAPI Spec Viewer parses the document, checks that it conforms to the structural rules of OpenAPI 3.0 or Swagger 2.0, and lists the paths and operations it finds so you can confirm the surface area of the API at a glance.

Parsing and validation happen entirely in the browser. You can paste a specification that contains internal hostnames, example credentials, or unreleased endpoints without transmitting it anywhere. The tool reports structural problems; it does not execute the API or check business-logic correctness.

Supported versions and formats

The viewer accepts both YAML and JSON. It recognizes the openapi field (3.0.x) and the swagger field (2.0). Documents that declare neither, or that declare an unsupported version, are rejected with a clear message.

YAML anchors and aliases are resolved when the parser supports them. JSON is treated strictly; comments are not allowed in JSON input.

Structural validation

Validation confirms the presence of required top-level fields (info, paths) and checks that each path item contains only recognized HTTP methods or parameters. Schema objects are examined for obvious structural errors such as missing type or invalid $ref syntax, but full JSON-Schema semantic validation of every schema is not performed.

When an error is found the tool reports the approximate location (line in YAML, or path in the object tree) so you can jump to the problem. Multiple errors are listed when the parser can continue.

Route and operation listing

After a successful parse the viewer extracts every path and the operations defined on it. Each operation shows its method, summary or operationId if present, and a short list of parameter names. This overview is useful for spotting missing endpoints or accidental duplicates before you generate client code.

The listing is read-only. You cannot edit the specification inside the tool; copy the corrected document back into your editor.

When to use this tool

  • Checking a newly written OpenAPI file before committing
  • Confirming that a generated specification still lists the expected routes
  • Diagnosing a parser error reported by another tool
  • Reviewing the public surface of an API described in a large YAML file
  • Teaching the required structure of an OpenAPI document

How to use the OpenAPI / Swagger Spec Viewer

  1. Paste the YAML or JSON specification into the input area.
  2. Click Validate / Parse.
  3. If errors appear, note the location, fix the source, and retry.
  4. When the document is valid, review the extracted list of paths and operations.
  5. Expand any operation to see its parameters and responses if the UI offers that detail.
  6. Copy the original text or the error messages as needed.
  7. Clear the input when finished.

Worked examples

Minimal OpenAPI 3.0 document

Input
openapi: 3.0.3\ninfo:\n  title: Sample API\n  version: 1.0.0\npaths:\n  /health:\n    get:\n      responses:\n        "200":\n          description: OK
Output
Valid OpenAPI 3.0.3\nPaths:\n  GET /health

Required fields are present; one operation is listed.

Missing required field

Input
openapi: 3.0.3\ninfo:\n  title: Incomplete\npaths: {}
Output
Error: info.version is required

The info object must contain both title and version.

Common mistakes and tips

  • Start with a minimal valid document and add paths incrementally so errors are easy to isolate.
  • YAML indentation errors are the most common cause of parse failure; use spaces, not tabs.
  • A $ref that points to a missing component produces a validation warning or error depending on the checker’s strictness.
  • Convert Swagger 2.0 documents to OpenAPI 3.0 with an external converter if you need 3.0-only features.
  • Large specifications with many schemas may take a second to parse; that is normal.

Frequently asked questions

Does it support OpenAPI 3.1?

The viewer targets OpenAPI 3.0 and Swagger 2.0. 3.1 documents may parse if they are compatible, but 3.1-specific keywords are not fully validated.

Can it resolve external $ref files?

No. Only internal references are considered. External files must be inlined or resolved before pasting.

Does it check example values against schemas?

No. It performs structural checks only, not full schema instance validation.

What happens with invalid YAML?

The YAML parser reports the line and column of the first syntax error.

Is the specification sent to a server?

No. Parsing and validation occur entirely in the browser.