# OpenAPI / Swagger Validator

Validate OpenAPI 3.0/3.1 and Swagger 2.0 documents structurally: required fields, path/operation completeness, response codes, $ref resolution, operationId uniqueness, and component integrity

> Canonical page: https://elysiatools.com/en/tools/openapi-validator

- **Category:** Validation

- **Keywords:** openapi, swagger, validate, validator, api, spec, lint, openapi 3, swagger 2, rest, schema, documentation

## Overview

The OpenAPI / Swagger Validator is a web-based utility designed to structurally validate OpenAPI 3.0/3.1 and Swagger 2.0 specifications. It checks for required fields, path and operation completeness, response codes, $ref resolution, operationId uniqueness, and component integrity to ensure your API documentation is accurate and compliant.

## Inputs

- **OpenAPI / Swagger Document** (textarea): openapi: 3.0.3 info: title: Example API version: 1.0.0 paths: /users: get: summary: List users responses: '200': description: OK

## When to use

- When debugging API specification errors before generating client SDKs or server stubs.
- When verifying that local OpenAPI 3.0/3.1 or Swagger 2.0 YAML/JSON files comply with official schema standards.
- When checking for broken internal $ref references or duplicate operationId values in large API definitions.

## How it works

- Paste your OpenAPI 3.0/3.1 or Swagger 2.0 document in YAML or JSON format into the input text area.
- The validator parses the document structure, resolving internal and external $ref references.
- The tool checks for schema compliance, including required fields, unique operation IDs, and valid response codes.
- Review the generated HTML report detailing any structural errors, warnings, or validation successes.

## Use cases

- Validating a newly written OpenAPI 3.0.3 YAML file before committing it to a Git repository.
- Troubleshooting broken schema references ($ref) in a complex Swagger 2.0 JSON document.
- Ensuring all API endpoints have defined response codes and unique operation IDs for SDK generation.

## Frequently asked questions

### Which OpenAPI versions are supported?

The validator supports OpenAPI versions 3.0 and 3.1, as well as Swagger 2.0.

### Can I validate both JSON and YAML formats?

Yes, the tool accepts both JSON and YAML formatted API specifications.

### How does the tool handle $ref resolution?

It automatically resolves internal references to components and schemas to verify their integrity.

### Why is operationId uniqueness important?

Duplicate operationIds cause code generation tools to fail or produce conflicting client SDK methods.

### Does this tool store my API specifications?

No, all validation is performed locally in your browser, and your API data is not saved.

## Related tools

- [Global Postal Code Validator](https://elysiatools.com/en/tools/global-postal-code-validator): Validate postal codes from multiple countries including US ZIP, UK Postcode, Canada, and more
- [IBAN & SWIFT Validator](https://elysiatools.com/en/tools/iban-swift-validator): Validate International Bank Account Number (IBAN) and SWIFT/BIC codes with checksum verification
- [Mod-11 Checksum Calculator](https://elysiatools.com/en/tools/mod11-checksum): Validate or generate numbers using the Modulus-11 (ISO 7064) check-digit algorithm with ISBN-10 (10..2), Norwegian-ID (3,7,6,1,8,9,4,5,2) and generic 2-7 weight schemes.
- [US ZIP Code Validator](https://elysiatools.com/en/tools/us-zip-code-validator): Validate United States ZIP codes including standard 5-digit and ZIP+4 formats
- [Currency Validator](https://elysiatools.com/en/tools/currency-validator): Validate ISO 4217 currency codes
- [Email Validator](https://elysiatools.com/en/tools/email-validator): Validate email addresses and check deliverability
- [.env File Validator](https://elysiatools.com/en/tools/env-file-validator): Validate .env files for syntax errors and common issues
- [Global Phone Validator](https://elysiatools.com/en/tools/global-phone-validator): Validate phone numbers from multiple countries including China, US, and more with detailed formatting and carrier info

## Samples

- [OpenAPI/Swagger Samples](https://elysiatools.com/en/samples/openapi): OpenAPI/Swagger specification examples for REST API documentation and contract definition
- [OpenAPI/Swagger Samples](https://elysiatools.com/en/samples/openapi-swagger): Comprehensive API documentation examples using OpenAPI 3.0 and Swagger specifications for RESTful services
- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion

## Related content

- [API Versioning and Breaking Change Review](https://elysiatools.com/en/hubs/api-versioning-breaking-change-review): Compare API versions, plan migrations, and accept compatibility before release. These tools do not replace real deployment or runtime monitoring.
