What Is OpenAPI Viewer & Validator?
OpenAPI Viewer & Validator is a 100% offline browser workspace for inspecting, linting, and documenting OpenAPI 3.0 / 3.1 and Swagger 2.0 YAML or JSON specifications without installing Swagger Editor or uploading private internal API definitions to a cloud server.
Every YAML/JSON parse, cycle-safe local $ref lookup, structural lint rule, example payload synthesis, cURL/fetch snippet, and Markdown/TypeScript export runs strictly in browser memory with zero network calls.
Key Features and Workflow
- Paste YAML/JSON or Drop a Spec File: Drop any
.yaml,.yml, or.jsonfile (up to 5 MB) or paste your specification into the editor. Click Sample OpenAPI 3.1 to explore a complete multi-tag API, or click Lint Error Demo to see broken$ref, duplicateoperationId, missing path parameter, and invalid status code diagnostics immediately. - Interactive Endpoint Explorer: Filter tag-grouped endpoints by keyword (
path,summary,tag,operationId) and HTTP method (GET,POST,PUT,PATCH,DELETE). Expand any operation to inspect merged path/operation parameters, auto-generated request and response example JSON bodies, and ready-to-copycURLand JavaScriptfetchsnippets. - YAML/JSON Format Switching and Local Drafts: Convert between clean YAML and formatted JSON in one click, and store frequently referenced specs in your browser’s local IndexedDB storage (clearing drafts removes only this tool’s saved specs).
Built-In Structural Linter Checks
The Linter tab scans your entire document and reports exact JSON/YAML paths for common contract bugs before they break client codegen:
- Spec Version & Metadata: Verifies valid
openapi(3.0.x/3.1.x) orswagger: "2.0"version declarations plusinfo.titleandinfo.version. - Cycle-Safe Local
$refIntegrity: Resolves every#/components/...or#/definitions/...JSON Pointer with circular-reference protection and flags unresolved local references (external remote$refURLs are flagged as offline warnings and never fetched). - Duplicate
operationIdDetection: Catches conflictingoperationIdnames across endpoints. - Path Parameter Consistency: Flags undeclared
{param}template variables and path parameters missingrequired: true. - Responses & Status Codes: Flags empty
responsesobjects and invalid HTTP status codes outside100~599,1XX~5XX, ordefault.
Export Markdown Docs and TypeScript Interfaces
Switch to the TS & Markdown tab or click the top download buttons to generate clean developer artifacts locally:
- TypeScript Types (
.types.ts): Convertscomponents.schemas(or Swagger 2.0definitions) into idiomaticexport interfaceandexport typedefinitions supporting$ref, arrays, enums,oneOf/anyOfunions,allOfintersections,nullable, and optional fields. - Markdown Reference (
.api.md): Generates tag-grouped Markdown documentation with parameter tables, JSON request examples, and response status summaries ready for GitHub READMEs or team wikis.