YAML Validator & Formatter
Finds YAML syntax errors by line and reformats YAML with clean indentation.
Check an OpenAPI 3 or Swagger 2 document, in YAML or JSON, for structural mistakes: missing required fields, broken references, undeclared path parameters, and duplicate operation IDs.
openapi.yaml or swagger.json file.paths./users/{id}.get.The document is parsed as JSON or YAML, then checked against the rules of its version:
openapi (3.0.x or 3.1.x) or swagger: "2.0", and an info object with title and version./, and its keys are valid HTTP methods or allowed extras such as parameters.{param} in a path is declared as a parameter with in: path and required: true, and no path parameter is declared that the path doesn't use.responses (required in 3.0 and 2.0), and operationId values are unique.$ref such as #/components/schemas/User points to something that exists.in value and are not declared twice.This fragment has two problems:
openapi: 3.0.3
info:
title: Users API
version: 1.0.0
paths:
/users/{id}:
get:
operationId: getUser
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Usr'paths./users/{id}.get: the path parameter id is not declared.paths./users/{id}.get.responses.200.content.application/json.schema: $ref #/components/schemas/Usr doesn't exist.$ref links to other files or URLs are listed but not followed.Swagger 2.0 was renamed OpenAPI when the specification moved to the OpenAPI Initiative in 2016. OpenAPI 3.0 and 3.1 are the newer versions. People still say "Swagger" for both.
Yes. YAML and JSON are both accepted, and the format is detected automatically.
Every {name} in a path needs a parameter with the same name, in: path, and required: true, either on the operation or on the path item.
No. It is checked in your browser, so internal API designs stay private.
Often used together with the OpenAPI Validator.
Finds YAML syntax errors by line and reformats YAML with clean indentation.
Validates JSON data against a JSON Schema (draft 2020-12 or draft-07) and lists every error.
Checks JSON syntax and explains any error in plain English.