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.
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.
Related Products
on GumroadDeveloper Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →You Might Also Need
OpenAPI Validator
Paste your OpenAPI 3.x spec (YAML or JSON) to validate structure, find missing required fields, detect duplicate paths, check for missing operationIds, and get errors and warnings with path references.
Open free tool →
OpenAPI Schema Validator
Paste OpenAPI 3.x YAML or JSON and get instant validation errors and warnings. Checks required fields, paths, operations, response codes, and components. Runs entirely in your browser.
Open free tool →
OpenAPI Mock Generator
Paste an OpenAPI spec and get mock response data for testing. Generates realistic sample JSON from your API schema definitions.
Open free tool →
More Free Tools
Related Articles
OpenAPI 3.1 vs Swagger 2.0: The Complete API-First Development Guide for 2026
Everything you need to know about OpenAPI 3.1 vs Swagger 2.0: key differences, API-first development methodology, tooling ecosystem, code generation, contract testing, migration guide, and best practices for 2026.
Best API Documentation Tools for Developers in 2025 (Swagger, Redoc, Scalar, and More)
A practical comparison of API documentation tools in 2025 — Swagger UI, Redoc, Scalar, Stoplight, and Mintlify — covering OpenAPI support, customization, hosting options, and developer experience.
Top 10 Free API Documentation Tools for Developers in 2026
The best free API documentation tools in 2026. Compare Swagger UI, Redoc, Stoplight, Scalar, and more—with practical guidance on which to choose for your project.
curl 深度使用手冊:API 測試從入門到進階
curl 是每位開發者必備的 CLI 工具。本文涵蓋 GET/POST/PUT/DELETE 請求、認證、header 設定、檔案上傳、除錯技巧,以及 REST API 測試的完整實戰範例。
API Testing Best Practices 2026: Postman vs Insomnia vs Bruno
Complete guide to API testing in 2026. Compare Postman, Insomnia, and Bruno, learn best practices for REST and GraphQL testing, and build automation pipelines that catch regressions before production.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$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.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →