Swagger Editor: Edit and Preview OpenAPI Specs

Write or paste an OpenAPI 3.0, OpenAPI 3.1, or Swagger 2.0 document in YAML or JSON. It is parsed and checked as you type, every problem links to its line, and a documentation preview is built beside the editor. Everything runs in your browser and nothing is uploaded.

Loading…

Spec source

YAML

Tab inserts two spaces and Enter keeps the indentation. Press Esc to leave the editor (focus moves to the export buttons).

Line 1, column 1

Problems

0

Select a problem to jump to its line in the editor.

    Documentation preview

    How it works and limits

    • Parsing: a built-in YAML reader (no libraries) handles what API specs use: block and flow mappings and sequences, plain, single-quoted, and double-quoted scalars, | and > block scalars with chomping and indentation indicators, comments, anchors, aliases, and << merge keys, with YAML 1.2 core-schema booleans, nulls, and numbers. Input that starts with { or [ is read as strict JSON with the browser’s JSON parser.
    • Refused on purpose: custom and local tags (only the core !!str, !!int, !!float, !!bool, !!null, !!map, and !!seq are accepted), complex ? keys, collections, aliases, anchors, or tags used as keys, multiple documents, and %TAG directives. Each is reported with a line and column instead of being guessed.
    • Validation is structural: version detection, required fields, path keys, HTTP method names, unique operationIds, path template parameters, parameter in values, response codes, security scheme names, and internal $ref targets and cycles. It is not a full check against the official OpenAPI JSON Schema, and examples are not validated against their schemas.
    • No network: external and remote $refs are listed but never fetched, and there is no “Try it out” button because this page sends no requests and cannot call your API.
    • Format and convert rebuild the text from the parsed data, so YAML comments are dropped, anchors and aliases are expanded, and integer-like keys such as 200 and 404 come before other keys (JavaScript object order). Use “Undo last action” to get the previous text back.
    • Descriptions are shown as plain text with a tiny safe subset of Markdown (paragraphs, lists, code, and bold). Links are shown as text, not made clickable.
    • Swagger is a trademark of SmartBear Software. This is an independent tool, not affiliated with or endorsed by SmartBear.