OpenAPI / Swagger Validator

Validate OpenAPI 3.0 and Swagger 2.0 specs in real time. Paste YAML or JSON, get instant feedback on required fields, operationIds, $refs, response codes, and security schemes.

Paste a spec to validate it.

Supports OpenAPI 3.0.x and Swagger 2.0

Frequently Asked Questions

What OpenAPI versions does this validator support?

The validator supports OpenAPI 3.0.x (detected via the `openapi` field) and Swagger 2.0 (detected via the `swagger` field). It checks the required structure and fields for each version. OpenAPI 3.1 uses the same field name as 3.0 and will pass most validation checks.

What does the validator check?

The validator checks: valid YAML or JSON syntax, presence of required fields (info, info.title, info.version, paths), valid HTTP methods on path items, unique operationIds across all operations, parameter definitions with name and in fields, valid HTTP response status codes, $ref reference resolution within the document, and security scheme references.

What is the difference between OpenAPI 3.0 and Swagger 2.0?

Swagger 2.0 is the predecessor to the OpenAPI Specification. OpenAPI 3.0 introduced significant improvements: the `components` object replaced `definitions`, `requestBody` replaced `body` parameters, and servers replaced the basePath/host fields. Most modern APIs use OpenAPI 3.0+.

Does the validator support external $ref references?

The validator checks local $ref references (those starting with #/) within the document and verifies they resolve to an existing path in the spec. External $refs (pointing to other files or URLs) are not fetched and will not trigger errors — this is expected behavior for a browser-based tool.