API Specification Editor
Paste or open an OpenAPI (Swagger) document in YAML or JSON. The page checks it as you type, against the official OpenAPI schema and common rules, and points to the line of each problem. Read it as documentation with example requests and responses, turn its schemas into TypeScript types, switch between YAML and JSON, or compare it with an older version. Nothing is uploaded.
Write and check
Documentation
Every operation of the document, grouped by tag. Open one to see its parameters and examples made from its schemas.
TypeScript, YAML and JSON
Compare with an older version
How to check an OpenAPI document
- Paste the document into the box, or press Or open a YAML or JSON file.
- The check runs as you type. The line above the list says which version was found and how many errors, warnings and notes there are.
- Press line … next to a problem to jump to it in the box.
- Open Documentation to read every operation with its parameters, an example request body and example responses.
What is checked
- OpenAPI 3.0 and 3.1: the whole document against the official JSON Schema of its version, published by the OpenAPI Initiative.
- Rules for every version: each {parameter} of a path is declared with in: path and required: true, operationIds are unique, every $ref points to something, paths that differ only in parameter names, responses with no description or no success code, security schemes that are used but not defined, tags that are not listed, and schemas no one uses.
- Swagger 2.0 and AsyncAPI are read and checked with the rules; the official schemas of those formats are not used here.
Worked example
The sample Library API has three operations. Change in: path to in: query under bookId and the page reports: GET /books/{bookId}: the path has {bookId} but no parameter named bookId with in: path is declared. Under Documentation, Get a book shows the example response {"title": "Anathem", "author": "Neal Stephenson", "year": 2008, "isbn": "string", "id": 42}.
Limits you should know
- References to other files ($ref: other.yaml#/...) are listed but not opened.
- Server code and client libraries are not generated; TypeScript types of the schemas are.
- The comparison looks at operations, parameters, responses and the properties of schemas; it does not compare every keyword.
- The YAML reader refuses a few rare YAML forms (such as custom tags) by name rather than guessing.