Home › Developer Tools › OpenAPI Editor

OpenAPI Editor

Write or paste an OpenAPI 3.0, 3.1 or Swagger 2.0 spec on the left and get live API documentation on the right: endpoints grouped by tag, parameters, request and response schemas with generated example JSON, and a Problems list with clickable line numbers. Your draft is saved automatically in this browser.

Last updated:

Your draft is saved automatically in this browser only (local storage) and is never uploaded. Click an endpoint's Edit link to jump to its YAML. Tab indents by two spaces; press Esc then Tab to leave the editor.

Advertisement
Advertisement

How to use the OpenAPI Editor

  1. Start from a template (the Task Tracker 3.1 example loads first), open your own .yaml/.json file, or paste a spec.
  2. Edit on the left: the documentation on the right refreshes as you type, and problems are highlighted in the gutter.
  3. Insert snippets for a new path, operation, query parameter, schema or security scheme; they are placed in the right section automatically.
  4. Check the Problems tab and click an item to jump to its line; use Edit on any endpoint to find its YAML.
  5. Download the finished spec as YAML or JSON, or copy it to the clipboard.

Anatomy of an OpenAPI document

Every OpenAPI 3 document is built from the same few top-level sections. Knowing where each piece belongs makes the editor's Problems list much easier to act on:

SectionRequired?What goes in it
openapiYesThe spec version as a string, e.g. 3.1.0 (Swagger 2.0 uses swagger: "2.0").
infoYestitle and version (of your API), optional description, contact and license.
serversNoBase URLs, optionally with {variables} such as an environment or region.
pathsYes in 3.0, optional in 3.1Each URL template (/tasks/{taskId}) with its operations: get, post, put, patch, delete…
componentsNoReusable schemas, parameters, responses, requestBodies and securitySchemes, referenced with $ref.
securityNoDefault authentication for all operations; operations can override it (use security: [] for public endpoints).
tagsNoNames and descriptions used to group operations in documentation.

Tips for writing specs by hand

  • Quote status codes and versions: write '200': and version: "1.0". Unquoted, YAML reads them as numbers.
  • Define schemas once: put models under components/schemas and reference them, so request, response and documentation stay consistent.
  • Use allOf for "create" vs "read" models: a NewTask schema plus Task = allOf [NewTask, {id, createdAt}], as in the template, avoids duplicating fields.
  • Give every operation an operationId: code generators use it as the method name, so keep it unique and camelCase.
  • Mark server-generated fields readOnly (ids, timestamps) so clients know not to send them; the example generator follows the same rule for writeOnly fields.
  • Describe errors: add 4XX responses or a shared default error response so client developers know what failures look like.

Only need to check an existing file? The OpenAPI Validator gives a full report and a dereferenced download. To browse a finished spec with search and Swagger UI, use the OpenAPI Viewer.

Frequently asked questions

Where is my spec stored?

Only in your browser's local storage on this device, so it is still there when you come back. Nothing is uploaded to a server. Clearing site data or using a private window removes the draft, so download important specs.

Is this the same as Swagger Editor?

It covers the same everyday workflow (edit YAML, see rendered docs and errors side by side) but is a lightweight, independent tool. It does not send test requests to your API; for that, export the spec and use an API client, or try the API Request Tester.

Should I write OpenAPI in YAML or JSON?

Both describe exactly the same document. YAML is easier to read and write by hand and allows comments; JSON is easier to generate and parse in code. The editor converts between them in one click (comments are not carried over to JSON).

Which OpenAPI version should a new API use?

OpenAPI 3.1 is the current version and aligns schemas with JSON Schema 2020-12 (for example type: [string, 'null'] instead of nullable). Use 3.0.3 if your code generator or gateway does not support 3.1 yet; Swagger 2.0 is only for older tooling.

How are the example payloads created?

For each request and response schema the editor builds sample JSON from example, default or enum values when present, and otherwise from the type and format (for instance a date-time string or a UUID). writeOnly properties are left out of examples.

Does it support $ref and allOf?

Yes. Internal references such as #/components/schemas/Task are followed in the preview, allOf schemas are merged into one property list, and oneOf/anyOf alternatives are listed. Recursive schemas are shown once with a recursion marker.

Can I use it offline?

After the page has loaded, editing, preview and validation work without a connection. The YAML parser is loaded from a CDN the first time; JSON specs work even if it cannot load.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

OpenAPI ValidatorValidate OpenAPI 3.0/3.1 and Swagger 2.0 specs: schema errors, broken $refs, line numbers.OpenAPI / Swagger ViewerView OpenAPI 2/3 JSON or YAML as interactive API docs with validation and an endpoint list.YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.QR Code GeneratorMake QR codes for links, Wi-Fi, email and more.Barcode GeneratorCreate Code 128, EAN-13, UPC-A, EAN-8, Code 39 and ITF-14 barcodes as PNG or SVG.UUID GeneratorGenerate UUID v4 and v7 / GUIDs in bulk and copy or download them.Schema Markup Generator (JSON-LD)Create JSON-LD structured data for FAQ, Product, Article and more.Htaccess & Nginx Redirect GeneratorBuild 301 redirects for .htaccess, Nginx and Netlify or Cloudflare _redirects.Fake Data GeneratorGenerate mock data as JSON, CSV or SQL.Random String GeneratorGenerate secure random strings and tokens in bulk with any length and character set.API Key GeneratorCreate secure API keys and secrets with prefixes, checksums and SHA-256 hashes for storage.MIME Type LookupFind the MIME type for any file extension, or the extensions for a MIME type, in 400+ entries.Cron Expression GeneratorBuild crontab schedules visually, read them in plain English and see the next run times.URL Slug GeneratorTurn titles into clean, SEO-friendly URL slugs: accents, stop words, separators and bulk lines.JSON Schema GeneratorTurn sample JSON into a draft 2020-12 JSON Schema with types, required fields and formats.Gitignore GeneratorBuild a .gitignore from 50+ templates for languages, frameworks, IDEs and OS, merged and deduped.License GeneratorCreate a LICENSE file for MIT, Apache, GPL, BSD, ISC, MPL or Unlicense with your name and year.ULID GeneratorGenerate sortable ULIDs and UUID v7 in bulk, monotonic option, and decode their timestamps.Htpasswd GeneratorCreate .htpasswd entries with bcrypt, APR1-MD5 or SHA-1 for Apache and Nginx basic auth.Placeholder Image GeneratorCreate placeholder images in any size, color and text as PNG, JPG, WebP, SVG or data URI.Ads.txt GeneratorCreate or validate ads.txt and app-ads.txt files: seller lines, cert IDs and variables.Docker Run to Compose ConverterConvert docker run commands to docker-compose.yml, or a compose file back to docker run.Dockerfile GeneratorGenerate a production Dockerfile and .dockerignore for Node, Python, Go or a static nginx site.HTML Boilerplate GeneratorTick the options you need and get a clean HTML5 starter template with meta, OG tags and CSS reset.JSON to Zod SchemaInfer a Zod (or Yup) schema from sample JSON with optional, nullable and z.infer types.Linux Commands Cheat SheetSearchable Linux and bash command reference with flags explained, examples and copy buttons.LLMs.txt GeneratorBuild an llms.txt file for AI crawlers: summary and link sections, import from your sitemap.Nano ID GeneratorGenerate secure Nano IDs with custom alphabet, length and count, plus a collision calculator.Nginx Config GeneratorBuild an nginx server block: static site, SPA, reverse proxy or PHP, with SSL, gzip and redirects.package.json GeneratorFill a form and get a valid, npm-ready package.json with scripts, dependencies and checks.PKCE Code Challenge GeneratorGenerate an OAuth 2.0 PKCE code_verifier and S256 code_challenge, build auth URLs, verify pairs.README GeneratorFill in a form and get a polished README.md with badges, install, usage and license, live preview.Regex GeneratorBuild regular expressions visually from blocks or presets (email, date, phone) and test them live.Commit Message GeneratorBuild Conventional Commit messages with type, scope, body, breaking change and issue refs.Database Schema DesignerDesign tables and relationships visually, then export SQL for MySQL, PostgreSQL or SQLite.Docker Compose GeneratorBuild a docker-compose.yml with a form: services, ports, volumes, env, healthchecks and presets.Dummy File GeneratorCreate test files of an exact size in KB, MB or GB with zeros, random bytes or text.Markdown TOC GeneratorGenerate a linked table of contents from Markdown headings with GitHub-style anchors.Pivot Table MakerBuild pivot tables from CSV or Excel by drag and drop: sum, count, average, charts, export.SQL Query BuilderBuild SELECT queries visually: joins, filters, GROUP BY, ORDER BY and LIMIT, as clean SQL.Truth Table GeneratorType a logic expression and get its full truth table, minterms and canonical DNF/CNF.TypeScript PlaygroundWrite TypeScript with live type checking, see the compiled JavaScript and run it in your browser.Article Schema GeneratorCreate Article, BlogPosting or NewsArticle JSON-LD with headline, authors, dates and images.Event Schema GeneratorCreate Event JSON-LD with dates, venue or online location, tickets, organizer and performers.Google Search Query BuilderBuild advanced Google searches with site:, filetype:, intitle:, exact phrases and date operators.HowTo Schema GeneratorCreate HowTo JSON-LD with steps, tools, supplies, total time and cost, then copy it.Htaccess GeneratorBuild an Apache .htaccess file: HTTPS, www, gzip, caching, error pages, IP blocks, hotlinks.HTML Email Template BuilderDrag and drop blocks to build a responsive, table-based HTML email with inline styles.Organization Schema GeneratorCreate Organization JSON-LD with logo, URL, contact points, address and social profiles.PIN GeneratorGenerate random 4, 6 or 8-digit PINs that avoid sequences, repeats, dates and common PINs.Product Schema GeneratorBuild Product JSON-LD with price, availability, brand, GTIN, ratings and reviews.Question Keyword GeneratorFind the questions people ask about a topic, grouped by who, what, why, how, can and more.Recipe Schema GeneratorCreate Recipe JSON-LD with ingredients, steps, prep and cook times, nutrition and ratings.Security Headers GeneratorPick HSTS, CSP, frame, referrer and permissions options and get Apache, Nginx, Netlify or Cloudflare config.SKU GeneratorBuild consistent SKUs from brand, category, size and color, then export every variant as CSV.Typography Scale GeneratorBuild a modular type scale from a base size and ratio, then copy CSS variables or a Tailwind config.WordPress Salt GeneratorGenerate fresh WordPress security keys and salts for wp-config.php, .env or Docker in one click.ANSI Color Code GeneratorStyle terminal text with 16, 256 or RGB colors and get escape codes for bash, Python, JS and C.Apache Virtual Host GeneratorCreate an Apache VirtualHost config with SSL, redirects, reverse proxy or PHP-FPM in seconds.Bash Prompt GeneratorDrag and drop a custom PS1 prompt for bash or zsh with colors, git branch and a live preview.Changelog GeneratorTurn Conventional Commit messages into a grouped Keep a Changelog Markdown file per version.cURL Command BuilderBuild curl commands from a form: method, headers, query, JSON or form body, auth and flags.Docker Compose to KubernetesConvert docker-compose.yml into Kubernetes Deployment, Service, ConfigMap and PVC manifests.Docker Compose ValidatorCheck a docker-compose.yml for YAML errors, schema mistakes, broken references and deprecated keys.Dockerfile LinterLint a Dockerfile for best practices: pinned tags, apt cleanup, non-root USER and layer count.Dockerignore GeneratorBuild a .dockerignore from Node, Python, Go and Java templates, plus your own entries.ESLint Config GeneratorGenerate a flat eslint.config.js for JavaScript, TypeScript, React or Node with rule presets.
See all 85 Code Generators & Builders →