Skip to main content

OpenAPI Spec Viewer

Paste an OpenAPI 3.x spec in JSON or YAML and get a clean, human-readable view. Browse endpoints grouped by tag, expand each one to see parameters and schemas, and explore all component definitions.

✓ JSON & YAML auto-detect ✓ Endpoints grouped by tag ✓ Inline $ref resolution

Frequently Asked Questions

What is OpenAPI and how is it different from Swagger?▼

OpenAPI (formerly Swagger) is the industry-standard specification for describing RESTful APIs. Swagger was the original name when SmartBear owned it. In 2016, the spec was donated to the OpenAPI Initiative and renamed to OpenAPI Specification (OAS). Today 'Swagger' often refers to the tooling (Swagger UI, Swagger Editor), while 'OpenAPI' refers to the spec itself. OpenAPI 3.0 was a major redesign over Swagger 2.0, introducing cleaner request body handling, multiple server support, and better component reuse.

What versions of OpenAPI does this viewer support?▼

This viewer is optimized for OpenAPI 3.0.x and 3.1.x specs. It also renders many Swagger 2.0 (OAS 2) documents since the core path/operation/schema structure is similar, though some OAS 2-specific fields like 'definitions' (vs 'components/schemas') and 'produces'/'consumes' are not fully parsed. For best results, use an OpenAPI 3.x spec.

Can I paste YAML or only JSON?▼

Both formats are supported. The viewer auto-detects the format: if your input starts with '{' it is treated as JSON and parsed with JSON.parse. Everything else is treated as YAML and processed with the built-in YAML parser. The YAML parser handles all OpenAPI-relevant constructs including nested mappings, sequences, block scalars, and inline values.

What do the colored method badges mean?▼

The color coding follows REST conventions: GET (green) retrieves data without side effects; POST (blue) creates a new resource; PUT (yellow) replaces a resource entirely; PATCH (orange) partially updates a resource; DELETE (red) removes a resource. HEAD and OPTIONS use gray as they are utility methods. These colors help you quickly identify the intent and safety characteristics of each endpoint.

What is a $ref in OpenAPI and how does this viewer handle it?▼

$ref is OpenAPI's way of referencing a schema defined elsewhere in the document, such as '#/components/schemas/User'. This avoids duplication and keeps specs maintainable. This viewer resolves $ref references inline when rendering endpoint details and schema tables — so instead of showing the raw $ref string, it follows the reference and displays the actual property list. Only local $ref references (within the same document) are resolved.

How do I generate an OpenAPI spec for my API?▼

Most frameworks have libraries that auto-generate OpenAPI specs from your code. For Node.js: fastify-swagger, tsoa, or @nestjs/swagger. For Python: FastAPI generates specs automatically; Flask/Django can use flask-smorest or drf-spectacular. For Go: swaggo/swag. For Java/Kotlin: springdoc-openapi or swagger-core. Alternatively, write your spec first using the OpenAPI 3.x specification directly in YAML — this 'API-first' approach is recommended for better design consistency.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →