OpenAPI / Swagger Validator

Checked against the official OpenAPI schema for the version you declare, plus $ref and operationId checks. Cmd/Ctrl+Enter saves this spec to history.

Advertisement

Paste an OpenAPI 3.0, 3.1, 3.2, or Swagger 2.0 document, in JSON or YAML. It's checked against the official OpenAPI schema for its version, which catches missing response descriptions, path parameters without required: true, Swagger 2.0 habits like in: body in a 3.0 file, typos in types, and fields the spec doesn't define. Each mistake gets one message that says where it is. The validator also checks what a schema can't: internal $ref targets that don't exist, and operationId values used more than once.

Frequently asked questions

Does this validate against the full OpenAPI schema?
Yes. The document is checked against the official JSON Schema published by the OpenAPI Initiative for its version: Swagger 2.0, OpenAPI 3.0, 3.1, or 3.2. That covers required fields, allowed values, types, and unknown fields everywhere in the document. One exception: for 3.1 and 3.2, the official schema checks only that each Schema Object is an object, and leaves its contents to a separate JSON Schema dialect, so a typo inside components.schemas is caught in 3.0 but not in 3.1.
What does it check beyond the schema?
Rules that compare parts of the document with each other, which a JSON Schema can't express: every internal $ref must point at something that exists, and no two operations may share an operationId. It also warns about paths that declare no operations.
Why do other validators show so many more errors?
The official schemas describe many fields as "a $ref or the real object" and parameters as "one of path, query, header, or cookie". A standard validator reports every alternative that didn't match, so one mistake can produce eight errors. This tool works out which alternative you meant and shows only its problem.
Why is my version field rejected?
openapi needs a full version with a patch number, like "3.1.0". In YAML, put it in quotes: an unquoted openapi: 3.0 is read as the number 3.
Can I paste YAML, or does it need to be JSON?
Either. OpenAPI specs are usually written in YAML, and the validator parses it directly.
Is my spec uploaded anywhere?
No. Validation runs in your browser tab. The YAML parser and the schema for your version download the first time you validate, and nothing you paste is sent to a server.

Read the full guide for this tool →

Related tools & guides

Part of API Contract Drift: Catching Breaking Response Changes

Advertisement