Gratis å bruke, uten konto

OpenAPI-redigerer

Rediger en OpenAPI-kontrakt, kontroller vanlige strukturproblemer og forhåndsvis de dokumenterte operasjonene. Teksten forblir i denne nettleseren.

Kontrollerer vanlig OpenAPI 3.0/3.1-struktur og lokale referanser; det er ikke en fullstendig standardsertifisering. Eksterne $ref-lenker avvises og hentes aldri. Ingen API-endepunkter kontaktes.

YAML-parserlisens (MIT)

Kan jeg prøve API-endepunkter her?

Nei. Denne redigereren kontrollerer og forhåndsviser bare kontrakten. Den sender aldri forespørsler til API-et som beskrives i filen din.

Veiledning

Slik bruker du OpenAPI-redigerer

The OpenAPI Editor is a text box for an OpenAPI 3.0 or 3.1 contract in JSON or YAML. You can paste or import a file, tidy its formatting, run a set of common structure checks, preview the operations it documents and download the result. It never calls the API your file describes and does not replace a full standards validator.

Slik gjør du

  1. Paste your contract into the document box, or import a JSON or YAML file of up to 300 KB. Leave the format on automatic detection, or pick JSON or YAML.
  2. Press Check contract. The tool lists the operations it found with their responses, and any findings with the place they were found.
  3. Fix the text and check again. Format document rewrites the text neatly in the same format.
  4. Press Download file to save the current document, or Copy report to copy the summary. Load example puts in a small valid contract.

Eksempler

A small valid contract

Du skriver inn
Format
YAML
Dokument
openapi: 3.1.0 info: title: Sample API version: 1.0.0 paths: /items/{itemId}: get: operationId: getItem summary: Read one item parameters: - name: itemId in: path required: true schema: type: string responses: "200": description: Item returned
Du får
Funn
0
Operasjoner
GET /items/{itemId} — Les ett element · 200

This is the example the page loads. It has a version, a title, a path, an operation id, a declared path parameter and a described response, so the checks find nothing to report.

Kjørt med verktøyets egen kode.

A missing operation id and path parameter

Du skriver inn
Dokument
The same contract, with the operationId line and the parameters block deleted
Du får
Funn
Add an operationId. (GET /items/{itemId}); Declare this path parameter with in: path. (GET /items/{itemId} · itemId)

The path has {itemId} in it, so a required parameter with in: path must be declared for it. Without the operationId line, the operation also has no id.

Kjørt med verktøyets egen kode.

A duplicate id and a broken local reference

Du skriver inn
Dokument
Two operations that both use operationId x, and a response that points to #/components/responses/Nope
Du får
Funn
operationId must be unique. (x); This local reference does not resolve. (#/components/responses/Nope)

Operation ids must be different across the whole contract. The reference starts with # so it is looked up inside the document, and nothing exists at that location.

Kjørt med verktøyets egen kode.

A remote reference is refused, not fetched

Du skriver inn
Dokument
A response with $ref: https://example.com/r.json
Du får
Funn
Only local JSON Pointer references are allowed; this reference was not fetched.

Only references that begin with # are followed. A web address is reported as a finding and the tool makes no request to it.

Kjørt med verktøyets egen kode.

Når det er nyttig

  • Catch a missing operation id, empty response description or undeclared path parameter before you share a contract.
  • Tidy the indentation of a JSON or YAML contract before you commit it.
  • Get a quick list of the operations and response codes a contract documents.
  • Look at a contract privately, without sending it to an online service.

Begrensninger

  • Only OpenAPI 3.0.x and 3.1.x are accepted. A Swagger 2.0 file is reported as an unsupported version.
  • It is not a full standards validator. It checks common version, info, path, operation, response, parameter and local reference rules, so use an authoritative validator for full schema conformance.
  • The size limit is 300 KB and 500 paths. Remote references are never downloaded, and YAML that reuses anchors or aliases is not accepted and shows as not valid JSON or YAML.
  • It sends no requests to your API, so it cannot test authentication, real responses or whether a server is online. Formatting YAML may drop comments.

Tips

  • Give every response a short description. The check treats a missing or empty description as a finding, even for a success code like 200.
  • Fix the first finding and check again. One mistake, like a missing parameter, can cause more than one line of output.
  • Keep a copy of your original file before you format it, in case you want the old layout or comments.

Kilder

Vanlige spørsmål

Can I try API endpoints from this editor?

No. The editor only reads and checks the contract text. It never sends a request to the API your file describes, so it cannot test responses, authentication or server availability. Use a separate API client for that.

Does it check everything in the OpenAPI standard?

No. It covers a practical set of rules: the version field, the info block, paths, operations and ids, response codes and descriptions, parameters and local references. Full schema conformance needs an authoritative validator.

Is my contract uploaded anywhere?

No. The text is parsed in your browser. For YAML, the page loads a small parser file from this site the first time, but your contract is never sent out and no conversion service is involved.

Which versions of OpenAPI work?

Versions written as 3.0.x or 3.1.x. The tool tests the openapi field against that pattern, so Swagger 2.0 files, which use a swagger field, are flagged with a version finding.

What does a remote reference finding mean?

Your contract refers to something by web address or by another file. The tool follows only references that start with #. It reports the others and does not fetch them, so a contract split across files cannot be fully checked here.

What is an operationId and does it have to be unique?

It is a string that names an operation. The OpenAPI specification says it must be unique among all the operations in the document. Tools that generate code often use it as a method name.

Why does a valid-looking YAML file say it is not valid?

The YAML may have a syntax error such as a wrong indent, or it may reuse anchors and aliases, which this tool does not accept. Try pasting the same content as JSON to see which one it is.

Kan jeg prøve API-endepunkter her?

Nei. Denne redigereren kontrollerer og forhåndsviser bare kontrakten. Den sender aldri forespørsler til API-et som beskrives i filen din.

Lastes OpenAPI-filen min opp?

Nei. Kontrakten tolkes i denne nettleseren. YAML-støtte laster inn en liten lokal parserfil første gang; det brukes ikke noe konverterings-API.

Utfører dette API-kall eller sjekker om en server er på nett?

Nei. Den kaller aldri API-et som beskrives i kontrakten, og kan derfor ikke teste autentisering, svar eller servert tilgjengelighet.

Validerer den hele OpenAPI-standarden?

Nei. Den kontrollerer vanlige regler for versjon, info, sti, operasjon, svar, parameter og lokale referanser. Bruk en autoritativ validator for full samsvar med skjemaet.

Lastes eksterne referanser ned?

Nei. Bare lokale JSON Pointer-referanser inne i dokumentet kontrolleres. URL-er og andre eksterne referanser rapporteres, men åpnes aldri.