API & HTTP

OpenAPI / Swagger Validator

Paste an OpenAPI 3.0 or 3.1 document, JSON or YAML, and check its structure - paths, operations, parameters, requestBody, responses, $ref targets and security schemes - with a JSON Pointer path and source line for every issue.

Guide: OpenAPI Validation Errors: Path Parameters and $ref

Ready.

What it does

Validate checks the document's structure against the parts of the OpenAPI 3.0/3.1 specification developers hit most often: required top-level fields, path and operation shape, parameters (including the path-parameter required: true rule and duplicate name+in detection), requestBody and response content, whether $ref targets actually resolve inside the document, security scheme fields, and common schema mistakes (like a required property that was never defined). Each issue reports a severity, a JSON Pointer path, a plain-English path like paths./users.get.responses.200, and - for JSON input - the exact source line and column. Format pretty-prints the document, and can convert it between JSON and YAML.

Good to know

  • This is a focused, hand-picked set of the highest-value structural checks - not a complete implementation of the OpenAPI specification (which runs to hundreds of pages) or a full JSON Schema validator for every possible components.schemas shape. A document with no errors here is very likely well-formed OpenAPI, but for formal compliance testing, also check it against the official schema.
  • For YAML input, line numbers are a best-effort text search for the relevant key and are marked "(approx.)" - YAML's parser here (shared with the site's other YAML tools) doesn't track source positions the way the JSON parser built for this tool does, so exact YAML positions aren't always possible.
  • A $ref to another file or a URL is reported as informational, not checked - this tool never makes a network request, so an external reference's target can't be confirmed either way.
  • A Swagger 2.0 document is detected and named explicitly rather than being run through OpenAPI 3.x rules it was never written for.

Example: three problems found in a small document

A short OpenAPI 3.0.3 document with one path, /users/{id}, produced this result: “OpenAPI 3.0 - 2 errors, 1 warning.” Each issue shows the severity, the path, the source line for JSON input and a plain message:

  • Error (line 11): the path parameter id is missing "required": true. “Path parameters must set "required": true.”
  • Error (line 25): the reference #/components/schemas/User does not resolve to anything in the document, because only a schema called Person exists.
  • Warning (line 38): required lists name, which is not defined in properties.

These are the mistakes that most often break code generators, documentation sites and API gateways. The Format mode pretty-prints the document and can also convert it between JSON and YAML.

Frequently asked questions

Does a clean result mean my API description is fully compliant?

Not necessarily. The validator checks a focused set of the most common structural mistakes. It is not a full implementation of the OpenAPI specification, so use a formal tool as well for compliance testing.

Why do I see line numbers only for JSON?

For JSON input the tool can point to the exact line and column. For YAML you get the JSON Pointer path and a plain-English path instead.

How do I check that code calls the API correctly?

Use the API Hallucination Check, which compares a code snippet with your OpenAPI document.

Is my document uploaded?

No. It is validated in your browser.

Privacy

This tool runs entirely in your browser, including for large documents handled by a background Web Worker. Your API specification is not sent to a server.

Share this tool

Your data is not included in this link.