Validate OpenAPI 3 / Swagger Specs Online Before CI

Validate OpenAPI 3 / Swagger Specs Online Before CI

Schema errors, broken $ref, missing responses: validate your OpenAPI 3.0–3.2 API contract in the browser.

05.08.2026
7 min read
Share this article:
openapiswaggerAPIValidateRESTTutorial

Validate an OpenAPI spec before merging

An invalid OpenAPI spec blocks client generators, fails API gateway imports, and delays contract reviews. Yet the most common issues (incomplete info, broken internal $ref, unsupported openapi version) often hide in a 500-line YAML diff. FastMinify's online OpenAPI validator checks OpenAPI 3.0, 3.1, and 3.2 schema conformance via @scalar/openapi-parser, entirely in your browser. Paste JSON or YAML, and the verdict, error paths, and spec stats appear with no server upload. Pair it with the OpenAPI formatter for readable reviews, then explore the API tools hub. If raw JSON syntax is suspect, start with the JSON validator. To optimize payloads once the contract is sound, see our REST API performance guide.

Catch OpenAPI 3.0–3.2 schema errors before CI or gateway import
JSON and YAML accepted, with auto-detection and a YAML fallback when JSON parsing fails
Internal #/… references checked; Scalar issue paths displayed
100% local: your spec never leaves the browser, which suits internal contracts
Fast workflow: validate → format → lint → commit

Honest limits and best practices

What validate-openapi does not do

A “valid” verdict means OpenAPI schema conformance, not that your API responds correctly in production.

No fetch of external or remote $ref URLs
No automatic multi-file bundling: one single-file spec per paste
No Swagger 2.0 validation
No security testing (real auth, effective scopes)
512 KiB input limit, so huge specs need local tooling or CI
Internal vs external references

#/ references are checked by Scalar. HTTP(S) references to other files are never resolved, so the spec must be self-contained for reliable browser validation.

Prefer a single file or bundle upstream with your CI tool
An unresolved external $ref may pass parse but fail elsewhere
Manually verify cross-repo imports after local validation
json-schema-to-openapi and openapi-to-json-schema on the hub for schema pivots
To validate data against a schema, use json-schema-validator and see our JSON Schema guide
CI integration and complements

The browser tool speeds up feedback before commit, while CI remains the source of truth for teams.

Paste the modified spec before git push, which is faster than a full pipeline
In CI: Spectral, openapi-cli, or Redocly depending on your stack
Combine with our CI/CD guide for broader automation
Document the target OpenAPI version (3.0 vs 3.1) in the repo README
Review schema breaking changes with json-diff on JSON exports

What the tool checks and rejects in OpenAPI 3 and Swagger 2

OpenAPI 3.x, the modern contract

OpenAPI 3.x describes REST endpoints, request and response schemas, security, and reusable components. FastMinify validates conformance to the OpenAPI meta-schema, not your API's runtime behavior.

Supported versions: 3.0.x, 3.1.x, 3.2.x
Typical required fields: openapi, info.title, info.version, paths
Components schemas, responses, and parameters, with internal refs resolved
Scalar does structural validation, not real HTTP call testing
YAML or JSON: same semantics after parse
Swagger 2.0 explicitly rejected

Documents with a root swagger: "2.0" key are not supported by this tool. The error message is explicit, so do not try to validate them here.

Swagger 2 uses swagger; OpenAPI 3 uses openapi
For a Swagger → OpenAPI 3 migration, use dedicated converters upstream
FastMinify does not claim Swagger 2 validation, which avoids false positives
After migration, re-validate with validate-openapi
Hybrid or malformed specs fail at parse before validation
Common errors in real-world specs

Beyond syntax, these structural gaps break CI or SDK generators.

An internal $ref pointing to a missing component causes a validation failure
An HTTP response without description violates an OpenAPI rule
A duplicate or missing operationId blocks some generators
Schema type incompatible with poorly nested nullable / oneOf
Mixing JSON Schema drafts in components causes 3.1 versus 3.0 conformance errors
Validate, lint, and format are different jobs

The API hub offers three distinct intents, so do not confuse them during PR review.

Validate checks OpenAPI schema conformance (Scalar) and returns a valid or invalid verdict
Format handles indentation and readability, and it does not fix semantic errors
Lint applies Spectral-style rules (operationId, tags…), and our OpenAPI lint and format guide covers them
Recommended order: validate → format → lint before merge
A JSON validator alone is not enough, because syntactically valid JSON can still be invalid OpenAPI

Validate an OpenAPI spec, step by step

Using the OpenAPI validator

The OpenAPI validator parses the input (JSON or YAML, max 512 KiB), then calls Scalar validate(). The result gives a status, the first error with its line when known, and an issue list with JSON Pointer paths.

Paste a single-file spec, because external URLs are never fetched
Live validation in the Monaco editor after a short debounce
Results panel: verdict, Scalar issues, and path and operation stats
https://… references are never downloaded, which is an intentional limitation
Swagger 2.0 → clear error message, no partial validation
Format before or after validation

The OpenAPI formatter rewrites JSON or YAML with a 2 or 4 space indent and an optional key sort. It helps human review and does not replace validation.

A readable format for PRs, with indentation aligned with the team
Optional key sort for stable diffs
Invalid OpenAPI input may still format if parse succeeds
Chain format → validate to spot errors on indented spec
Large YAML: check the 512 KiB limit before pasting
A broken spec before an API Gateway import

You export a spec from a design tool and AWS API Gateway / Kong import fails with no detail.

1

Paste it into validate-openapi

Open validate-openapi. If parsing fails, fix the JSON or YAML syntax first, and the JSON validator can help on JSON portions.

2

Fix internal $ref

Scalar issues list the path (missing #/components/schemas/User, etc.). Fix the typo or add the referenced component.

3

Format and commit

Run the validated spec through format-openapi, download, open the PR. Re-import into the gateway.

Contract review before SDK generation

The mobile team generates a client from the spec, and a schema error blocks the entire pipeline.

1

Validate the merged version

Paste the main branch spec into validate-openapi. An invalid verdict means you should block the version tag.

2

Check info and paths

Complete info fields, every operation has responses with description. Results panel stats help spot empty paths.

3

Minify embedded JSON examples

Bulky embedded examples slow reviews, so use the JSON minifier on example payloads once the spec is valid.

Conclusion

Validating an OpenAPI spec before CI saves hours debugging gateway imports or silent SDK generators. Paste, validate, and fix the Scalar paths, all locally. Format for review, then explore the API hub for lint, JSON Schema conversion, and GraphQL validation.

Validate before every PR touching an OpenAPI spec
Do not use this tool for Swagger 2.0, and migrate first
Bundle external $ref upstream for reliable browser validation
Chain validate → format → lint for a complete review
See the REST JSON guide to optimize payloads once the contract is healthy
Share this article
Share this article: