What does the Swagger validator check?
It verifies the structural rules every Swagger 2.0 / OpenAPI document must satisfy: presence of the version field (swagger: "2.0" or openapi: "3.x"), info.title, info.version, at least one path under paths, every path key starting with "/", and every operation (get, post, put, etc.) having a responses block. It also warns when operations lack a summary, description, or operationId.
Does it accept both JSON and YAML?
Yes. The validator auto-detects format — input starting with "{" is parsed as JSON, otherwise as YAML. Most teams hand-edit specs in YAML and the validator handles both flavours equally.
What is the difference between Swagger and OpenAPI?
Swagger 2.0 (released 2014) was donated to the Linux Foundation and rebranded as OpenAPI 3.0 in 2017. The Swagger name now refers to the tool ecosystem (Swagger UI, Swagger Editor, Swagger Codegen) while OpenAPI refers to the specification itself. This validator handles both Swagger 2.0 and OpenAPI 3.x.
Is this a full schema validator?
No. It checks the most common structural rules — the ones that break Swagger UI, code generators, and gateway imports. For full JSON-Schema-based validation against the official OpenAPI meta-schema, use spectral, openapi-validator (IBM), or redocly lint locally.
Why does it report line numbers when YAML and JSON have different structure?
The validator scans the raw input text for the first occurrence of the problematic key (e.g. the path "/pets" or the field "info") and reports that line. The number is approximate but jumps you close enough to fix the issue in your editor.
Will my spec be uploaded to a server?
No. The validator runs entirely in JavaScript inside your browser. Specs containing internal hostnames, example bearer tokens, or proprietary endpoints never leave your device — verify in your browser DevTools Network tab.
How does this differ from the OpenAPI Validator on this site?
The Swagger Validator is more permissive: it accepts both Swagger 2.0 and OpenAPI 3.x, and focuses on universal structural rules. The OpenAPI Validator is OpenAPI 3.x-specific and adds checks for $ref resolution, security schemes, and per-response status codes.
Why do I get "missing responses" warnings?
OpenAPI requires every operation to declare at least one response — the spec is not valid otherwise. Code generators and Swagger UI will refuse to render an operation without a responses block. Add a default 200 (or 204 for empty) and the warning disappears.