OpenAPI Swagger Editor and Viewer

Write or open an OpenAPI file, see errors as you type, browse the generated docs by tag, and copy example payloads and request snippets.

Berjalan di browser Anda. File Anda tidak pernah keluar dari perangkat. Lihat cara memeriksa

…

Cara melakukannya

  1. 1
    Start from a template

    Keep the pet shop example or choose Minimal API from Templates, or open your own YAML or JSON file.

  2. 2
    Edit the source

    Type in the editor; problems update in the panel beside it with their location.

  3. 3
    Fix errors and warnings

    Read each message and its path, correct the source, and watch the status turn valid.

  4. 4
    Review the docs

    Open Docs preview, filter operations and expand one to check parameters and responses.

  5. 5
    Take examples and snippets

    Copy mock responses or request snippets, or download all mocks as JSON.

  6. 6
    Save the file

    Download YAML or JSON, or save the project file to continue later.

Tentang alat ini

An OpenAPI document describes an HTTP API in one file: its servers, paths, parameters, request bodies, responses and data schemas. This editor lets you write that file in YAML or JSON and immediately see three things: a list of structural problems found against the OpenAPI 3.0 and 3.1 rules, a readable documentation page grouped by tag, and example JSON for every schema. It opens with a complete pet shop example so you can learn the structure by changing it. Everything runs in the page, so an unpublished internal API description stays on your machine.

Who it is for

API designers writing a contract before code exists, back-end developers documenting an existing service, front-end developers who need example payloads, and technical writers reviewing an API description.

What the validator checks

The checks follow the specification text rather than a style guide: - an openapi version of 3.0.x or 3.1.x, and info with title and version - path keys that start with "/", and every {template} in a path declared as a path parameter with required: true - parameters with a name and a valid in (query, header, path or cookie) - operations with a responses object, and response codes that are numbers, ranges such as 4XX, or default - operationId values that are unique across the document - local $ref pointers that actually resolve Warnings point at softer issues such as missing operationIds, parameters without a schema or a body on GET.

Documentation preview

The Docs tab lists operations by tag with coloured method badges. Open one to see its parameters table, request body example, responses with their examples and a ready request snippet in cURL, fetch or Python. Filtering by path or summary helps in large files.

Mock examples

For each successful JSON response the tool builds an example: it uses example, default, const or the first enum value when the schema gives one, merges allOf parts, picks the first oneOf or anyOf option and otherwise produces a value from the type and format (dates, emails, UUIDs). Download them one by one or as a single JSON file for front-end fixtures or a mock server.

Converting and formatting

Format as YAML or convert to JSON in one click. Both keep the content and drop comments, so keep a copy of a hand-commented file.

Worked example

In the pet shop template, change the path /pets/{petId} to /pets/{id} without renaming the parameter. Two errors appear at once: the template {id} is not declared, and the parameter petId does not appear in the path. Rename the parameter to id and the status returns to valid structure.

Limits

These are structural checks, not a full JSON Schema meta-validation, and external $ref files or URLs are not fetched. Swagger 2.0 files are displayed but checked with the OpenAPI 3 rules, so convert them first. Generated examples are illustrations, not real data, and the snippets do not call the API for you.

Contoh perhitungan

Changing {petId} to {id} in a path gives 2 errors until the parameter is renamed to match.

Fakta singkat

Pertanyaan yang sering diajukan

Does it support Swagger 2.0?

It can show a Swagger 2.0 file, but the checks follow OpenAPI 3, so convert 2.0 files to 3.x first.

Is my API description uploaded?

No. Parsing, validation and the docs preview all run in your browser.

Can I use JSON instead of YAML?

Yes. Paste either; Convert to JSON and Format as YAML switch between them.

How are the mock responses made?

From your schemas: explicit examples and defaults first, then typical values by type and format.

Are external $ref files resolved?

No, only references inside the same document (starting with #). External ones are reported as warnings.

Can I copy request code for an operation?

Yes. Each operation in the docs preview has cURL, fetch and Python snippets built from the first server URL.

Sepenuhnya gratisTanpa biaya, tanpa daftar
File tetap pribadiSemuanya berjalan di browser Anda
Mudah dalam bahasa AndaTersedia dalam banyak bahasa