Swagger 2.0 Validator
Paste a Swagger 2.0 definition, in JSON or YAML, to check that it has the swagger version field, an info object with title and version, and a paths object. Path entries are scanned for a leading slash and for keys that are not standard operations.
How to check a Swagger 2.0 file
-
1
Copy your definition
Copy the full `swagger.json` or `swagger.yaml`, starting with the `swagger: "2.0"` line.
-
2
Paste it in
Paste it into the OpenAPI / Swagger document field.
-
3
Run the check
Continue to the results step to get the errors and warnings.
-
4
Update and recheck
Apply the fixes in your file and paste the new version until the report is clean.
What counts as a Swagger 2.0 pass
For a 2.0 file, the version check is satisfied by a top-level swagger key. The tool does not verify that its value is "2.0", so it will not catch a wrong number. Beyond the version, it needs info.title, info.version and a paths object.
Fields that are specific to Swagger 2.0, such as host, basePath, schemes, definitions and securityDefinitions, are not examined. A missing host or a broken definitions block will not be reported.
A worked example
{
"swagger": "2.0",
"info": { "title": "Shop API", "version": "1.0" },
"paths": {
"/products": {
"get": { "summary": "List products" },
"x-internal": true
}
}
}
The version field, info and paths are all there, so there are no errors. The report shows one warning:
| Finding | Type | Why |
|---|---|---|
| Unknown method ‘x-internal’ on /products. | Warning | The key is not a standard operation or path-item field |
The document is still reported as valid, because warnings do not block validity. Vendor extension keys like x-internal are legal in Swagger 2.0, so you can leave it in place.
Migrating from 2.0
If you plan to move to OpenAPI 3.x, you can paste the converted file into the same box and compare results. The check is the same, with the openapi field replacing swagger. Run a full converter and linter for the real migration work, since this tool does not translate definitions or host settings.
When a quick check is enough
Swagger 2.0 definitions often live for years in repositories and get edited by hand. A fast structural check is useful when you inherit one, when a tool refuses to load it and you suspect a missing field, or when you merge two files and want to be sure the result still has its info and paths sections. For the full 2.0 rules, including definitions and security settings, follow up with a dedicated linter.
Keep in mind that a clean report is a statement about structure only. Operations without responses, wrong parameter types and unresolved references are outside this check, so test the file in your documentation or code generation tool as well.
Frequently Asked Questions
No. It checks that the swagger or openapi field exists, not what it contains.
No. Only the version field, the info object, the paths object and the entries under each path are checked.
Yes. The text is read as JSON first and as YAML if that fails. Keep the indentation unchanged when you paste.
Path-level parameters, summary, description and servers are on the list of accepted keys, so they do not trigger the unknown-method warning.
Related Tools
Color Wheel Explorer
Explore the colour wheel interactively. Rotate harmonies, compare HSL vs RYB, spot complementary and triadic pairs in real time.
FPS Counter
Measure browser FPS with requestAnimationFrame, smoothing, min/max frame rate, warnings and an optional graph. Runs locally with no upload or API.
Random Phone Number Generator
Generate 1 to 50 fictional phone numbers from officially reserved ranges for the US, Canada, UK, Australia or Germany.
Placeholder Image Generator
Create a 1–4000 px placeholder with custom colors and text, download it as PNG, or copy a URL and HTML image tag.
GitHub Profile README Generator
Build the README.md for your GitHub profile page (the username/username repo) with tagline, skills, stats cards and language breakdown.
Color Name Finder
Find the closest standardized CSS color name for a HEX, RGB or HSL value using CIEDE2000 color difference.
Tool available in other languages
- Công cụ kiểm tra Swagger 2.0 [VI]
- Validator Swagger 2.0 [ID]
- Swagger 2.0-validerare [SV]
- Swagger 2.0 검증기 [KO]
- Validateur Swagger 2.0 [FR]
- Swagger 2.0 Validator [NL]
- Swagger 2.0 Validator [DE]
- ตัวตรวจสอบ Swagger 2.0 [TH]
- Validador Swagger 2.0 [PT]
- Validador de Swagger 2.0 [ES]
- Walidator Swagger 2.0 [PL]
- مدقق Swagger 2.0 [AR]
- Swagger 2.0 バリデーター [JA]
- Validatore Swagger 2.0 [IT]
- Валидатор Swagger 2.0 [RU]
- Swagger 2.0 Doğrulayıcı [TR]
- Swagger 2.0 验证器 [ZH]