OpenAPI Validator - Professional OpenAPI 3.0 and Swagger 2.0 Specification Checker
Free online OpenAPI validator for checking OpenAPI 3.0 specifications and Swagger 2.0 specs. Check required fields, path definitions and operations, and count schema objects and security schemes, following the OAS specification. Works with JSON and YAML formats. Perfect for API developers using Swagger UI, Postman, Redocly, and Stoplight.
OpenAPI Specification Validation and Structure Checking
Check the info object, path items, operation objects and their responses in an OpenAPI or Swagger definition, and count its component schemas.
How to Validate Your OpenAPI Specification
Check your OpenAPI 3.0 or Swagger 2.0 spec for errors, warnings, and structural issues
Paste Your OpenAPI Spec
Paste your OpenAPI 3.0 or Swagger 2.0 specification into the editor. You can use JSON or YAML format — the validator auto-detects the format:
Example: OpenAPI 3.0 Specification Input
A minimal OpenAPI 3.0 spec with one endpoint and one schema:
openapi: 3.0.0 info: title: User Management API version: 1.0.0 description: Manage users in your application servers: - url: https://api.example.com/v1 paths: /users: get: summary: List all users responses: '200': description: Successful response
Review the Results
There's no Validate button. The check runs a moment after you stop typing, using a subset of the OpenAPI Specification rules. It looks at:
openapi (or swagger), info.title, info.version, and pathsresponses objectscomponents.schemas, security schemes, and API tags. What's inside them isn't validatedExample: Validation Results Panel
A spec with one error and one warning produces this output:
✗ INVALID Specification 1 error · 1 warning Spec Summary Title My API API Version — Spec Version OpenAPI 3.0.0 Paths 2 Operations 3 Issues (2) [ERROR] info.version "info.version" is required. [WARN] paths./users.post Operation "POST /users" should have a "summary" or "description".
Fix Issues and Copy the Report
Fix the errors in the editor and the results update as you go. Then take the spec to your other tools:
What is OpenAPI Validation?
OpenAPI validation checks whether an API specification conforms to the OpenAPI Specification (OAS) — the industry-standard format for describing RESTful APIs. A valid spec ensures your API documentation, client SDK generation, and testing tools all work correctly. The OpenAPI Specification is maintained by the OpenAPI Initiative and is the authoritative reference for all validation rules.
Both OpenAPI 3.0 (the current standard) and Swagger 2.0 (the predecessor) follow a structured schema: a top-level version field, an info object describing the API, a paths object listing all endpoints, and optional components for reusable schemas and security schemes. Tools like Swagger Editor and Stoplight rely on valid specs to render interactive documentation.
This validator checks structural correctness: required fields, path format rules, operation definitions, and response objects. A validated spec can be imported into Postman to auto-generate API collections, used with OpenAPI Generator to create client SDKs in 50+ languages, and rendered by Redocly for beautiful API documentation. Convert a JSON example to an OpenAPI spec with our JSON to OpenAPI converter.
Frequently Asked Questions
What is the difference between OpenAPI 3.0 and Swagger 2.0?
OpenAPI 3.0 is the current industry standard maintained by the OpenAPI Initiative. It replaced Swagger 2.0 with major improvements: a unified components object (vs separate definitions), multiple server URLs, improved request body handling, and support for oneOf/anyOf/allOf. Swagger 2.0 is still widely used but is now legacy. This validator supports both.
Does the validator support both JSON and YAML formats?
Yes. The validator auto-detects the format — paste JSON (curly braces) or YAML (indented key-value pairs) and it will parse correctly. Both formats are functionally equivalent per the OpenAPI Specification. Most API developers prefer YAML for its readability, while JSON is easier to generate programmatically.
What does the Spec Summary show?
After validation, the Spec Summary shows: API title and version from your info object, the OpenAPI/Swagger version, the total number of paths (URL patterns) and operations (HTTP method + path combinations), the count of component schemas (reusable data models), and any security schemes and tags defined. This gives you a quick overview of your API's scope and completeness.
Can I use the validated spec with Swagger UI or Postman?
Usually, but a clean result here is not a guarantee. This page checks the outline of the spec: the version field, info, paths, and a responses object on every operation. It doesn't follow $ref links or check schemas, parameters and examples, so Swagger UI, Postman, Redocly or OpenAPI Generator can still reject a spec that passes here. When one of them complains, its message usually points at exactly the part this checker skips.
What are the most common OpenAPI validation errors?
The most frequent errors are: missing info.version field, operations without a responses object (required by the OAS spec), paths that don't start with /, and using the wrong top-level field (swagger in OAS 3 specs or openapi in Swagger 2). Common warnings include missing servers array and operations without descriptions.
How do I generate an OpenAPI spec from existing JSON data?
Use our JSON to OpenAPI converter — paste any JSON example (like an API response) and it generates a complete OpenAPI 3.0 spec with schemas inferred from your data types. Then paste the generated spec here to validate it. You can also use Swagger Editor or Stoplight Studio to create specs visually and validate them here.
Is the OpenAPI validator free to use?
Yes, and there's nothing to sign up for. The check runs in your browser, so the spec you paste or upload isn't sent anywhere. There's no hard size limit, but a spec tens of thousands of lines long will make the editor slow to scroll.
Related Tools
JSON to OpenAPI
Generate OpenAPI/Swagger specifications from JSON examples. Infer data types and create complete API schemas automatically.
OpenAPI Fixer
Fix broken OpenAPI and Swagger specifications automatically, repair malformed paths, schemas, $ref references, and YAML syntax errors
OpenAPI to Rust
Generate type-safe Rust API client code from OpenAPI/Swagger specifications with serde annotations.
OpenAPI to Go
Generate type-safe Go structs with JSON tags from OpenAPI 3.0 and Swagger 2.0 specifications.
OpenAPI to TypeScript
Convert OpenAPI 3.0 and Swagger 2.0 specifications to TypeScript interfaces and types. Auto-generate type-safe TypeScript from any OpenAPI schema.
OpenAPI to Markdown
Convert OpenAPI 3.0 and Swagger 2.0 specifications to readable Markdown API documentation. Generate endpoint tables, parameter docs, and schema references.