Developer

OpenAPI Spec Validator

Validate an OpenAPI or Swagger specification and catch the errors that pass validation but break generated clients.

Last reviewed by the Radiatus Cloud team

Need this built for your product?

We design, build & host secure software & APIs.

Talk to an engineer

Valid is a low bar

A specification can satisfy the JSON Schema for OpenAPI and still be nearly useless. Validation confirms structure: required fields present, types correct, references resolvable. It says nothing about whether the spec describes what the API actually does, whether the examples work, or whether a generated client will function. Most of the real problems sit above the validator's reach.

Version differences that bite

Swagger 2.0 and OpenAPI 3.x are structurally different, not cosmetically. Bodies moved from a parameter with in: body to a dedicated requestBody. definitions became components/schemas. Host, basePath and schemes collapsed into a servers array. Tools frequently accept both and behave differently, so a spec converted by a machine and never reviewed often carries fragments of the old shape that validate and mislead.

Unresolvable and circular references

A $ref pointing at a missing definition or an external file that has moved fails at generation rather than validation in some tooling. Circular references are legal and represent genuine recursive structures, but many code generators either loop forever or silently truncate the type. If a generated client is missing a nested field, a circular reference is a likely cause.

Undocumented responses are the common gap

Specs routinely document 200 and nothing else. Generated clients then have no type for the error body, and consumers write their own guesses. Every status code the API can return, with its schema, belongs in the spec — particularly 400, 401, 403, 404 and 422, since those are the ones client code has to handle.

Examples must be real

Hand-written examples drift from the schema and from the implementation, and nothing catches it unless examples are validated against their own schema. An example that contradicts its schema is worse than none, because documentation readers trust it and build against it. Generating examples from the schema, or validating them in CI, keeps them honest.

Generate the spec, or verify it against the code

A specification maintained by hand alongside an implementation diverges — not gradually, but at the first hurried change. Either generate it from code annotations, or run contract tests that exercise the real API against the spec in CI. A spec nobody verifies describes the API as somebody once intended it, which is the state most public API documentation is in.

Related tools

  • JSON Formatter — Format and beautify JSON in your browser. Pinpoints syntax errors by line and column, flags unsafe integers, and never uploads your data to a server.
  • JSON Validator — Validate JSON syntax with precise line and column errors, and check documents against a JSON Schema. Runs locally in your browser, nothing uploaded.
  • Regex Tester — Test regular expressions against sample text with live match highlighting, capture groups and flag control. Runs entirely in your browser.
  • HTML Minifier — Minify HTML by removing comments and redundant whitespace, without breaking inline elements or pre blocks. Runs entirely in your browser.

Frequently Asked Questions

Does a valid spec mean a good spec?

No. Validation checks structure only. It cannot tell whether the spec describes what the API actually does, whether examples work, or whether a generated client will function.

What changed between Swagger 2.0 and OpenAPI 3?

Request bodies moved from a body parameter to requestBody, definitions became components/schemas, and host, basePath and schemes collapsed into a servers array. Converted specs often retain fragments of the old shape.

Why is my generated client missing a field?

Often a circular reference. They are legal and represent genuine recursive structures, but many generators loop or silently truncate the type.

Which responses should I document?

Every status code the API can return with its schema, especially 400, 401, 403, 404 and 422. Documenting only 200 leaves client code with no type for the error body.

How do I keep a spec accurate?

Generate it from code annotations, or run contract tests against the real API in CI. A hand-maintained spec diverges at the first hurried change.

Privacy & Security

Validation done locally.

Data: None
Client-side-Side
Active
v1.0

About This Tool

This tool runs entirely in your browser. No data is sent to any server, ensuring complete privacy. Simply use the interface above to get started — no registration or login required.

Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.