DevTools Logo

OpenAPI Spec Diff

OpenAPI Spec Diff

Compare two OpenAPI documents and get a breaking-change report with suggested semver impact, ready for a PR or CI gate.

Runs in your browserold 3.0new 3.0
Try an example

Old · released

35 lines · 1,007 chars

New · proposed

40 lines · 1,234 chars

Ignore rules

local preference only
Tolerated rules

Breaking-change report

12 findings
Suggested bump: MAJOR5 breaking5 compatible2 metadata

Examples

New required query parameter

Input
old: GET /orders?limit=…   new: GET /orders?limit=…&tenant=… (tenant required)
Output
parameter.added-required · breaking · $.paths["/orders"].get.parameters[query:tenant]

Clients do not send the new parameter, so their requests will be rejected without a MAJOR bump.

Response enum gains a value

Input
old: status enum ["open","closed"]   new: ["open","closed","archived"]
Output
schema.enum-changed · breaking · side=response

Clients switch on the old set; a new value can break destructuring or exhaustive handlers. Removing a value is compatible.

Request body becomes optional

Input
old: requestBody.required = true   new: requestBody.required = false
Output
request.required-changed · compatible · MINOR

Requests that already send a body stay valid; Swagger 2.0 in:body required maps to this flag.

Identical documents

Input
old = new
Output
0 breaking · 0 additive · 0 metadata · NONE

The success state explicitly confirms that no version bump is needed.

About this tool

An OpenAPI diff answers a question a text diff cannot: will existing clients still work after this spec change? The tool parses two documents, resolves internal $refs, and compares them as operations, parameters, request bodies, responses and schemas. Each change gets a rule id, both JSONPaths, an old→new snippet and a plain-language explanation.

Compatibility follows the direction data travels. Request-side narrowing is breaking: a newly required parameter or property, a removed enum value, a narrowed type, or removing nullability can reject payloads clients already send. Response-side widening is breaking: a new enum value, a wider numeric type, added nullable, or a new oneOf branch can produce responses clients cannot parse. The opposite directions are compatible-additive and are labelled as such.

OpenAPI 2.0 documents are mapped into the 3.x model before comparison: definitions to components.schemas, body/formData parameters to requestBody, host and basePath to servers, collectionFormat to style/explode, and securityDefinitions to securitySchemes. OpenAPI 3.1 type arrays with null and numeric exclusive bounds are normalized into 3.0 terms so those changes are visible to the same rules engine.

The summary counts breaking, compatible and metadata changes and suggests MAJOR, MINOR or PATCH. Findings can be filtered by severity or category, explained in a side-by-side detail drawer, and exported as PR-ready Markdown or JSON for CI. Ignore rules hide known exceptions; the report reflects exactly what remains after they are applied.

Everything runs inside the browser tab. Unreleased API documents are never uploaded, and only your ignore preferences are saved locally.

What this tool does not do

  • External $ref files are not fetched: a ref is compared by identity only, so an inline→external move cannot be verified structurally.
  • Recursive schemas are compared one level deep with a shape-identity note; deeply recursive differences may be missed.
  • Webhook and 3.1 components.messages awareness covers operation discovery, not message payload semantics.
  • A path-template parameter rename is reported as a removed + added endpoint plus a possible-rename note; the tool cannot confirm intent.
  • Ignore rules are local preferences and are not embedded in the exported report; export them separately for reproducible CI gating.
  • Specs are limited to 10 MB per pane and are processed on the main thread; very large documents can briefly delay the UI.

How to use this tool

  1. Paste the released spec

    Put the current, published OpenAPI 2.0 or 3.x document in the left pane. JSON and YAML are both accepted.

  2. Paste the proposed spec

    Put the document from the PR or the new API version in the right pane. Version chips show what was detected.

  3. Review the summary

    Breaking findings drive a MAJOR suggestion; additive-only changes suggest MINOR; documentation-only changes suggest PATCH.

  4. Filter and inspect

    Use the severity and category filters, then click a finding to see rule id, JSONPaths, snippets and rationale. Arrow keys move through the list; Escape closes the drawer.

  5. Apply ignores and export

    Add JSONPath prefixes or tolerate specific rules for migration eras, then copy or download the Markdown report for the PR and the JSON report for CI.

Use cases

Review an API PR

See whether a spec change breaks clients before approving a version bump, including schema-level narrowing that text diffs miss.

Gate a release

Export the JSON report and fail the pipeline on breaking findings; export the ignore rules alongside it for reproducible verdicts.

Plan SDK regeneration

operationId changes, deprecations, removed parameters and new response variants tell SDK teams what regeneration will affect.

Migrate from Swagger 2.0

Diff a 2.0 document against its 3.x rewrite and confirm that the mapping preserved the contract.

Supported specification inputs and report sections

Input / outputWhat the tool does
OpenAPI 3.0 / 3.1 (JSON or YAML)Parsed directly; 3.1 type arrays, numeric exclusive bounds and webhooks are normalized before comparison.
Swagger 2.0Mapped to a 3.x-equivalent model: definitions, body/formData parameters, collectionFormat, host/basePath and securityDefinitions.
Internal $refsDereferenced with memoization; cycles become shape-identity notes instead of infinite loops.
External $refsSkipped and counted; two identical references compare equal, changed references are reported as a note.
Markdown reportPR-ready sections grouped by severity with rule ids, JSONPaths and explanations.
JSON reportStable summary, version/stats metadata and a findings array for automated gating.

A version mismatch produces a warning chip and both sides are mapped to the same model before diffing; the original formats are never modified.

Common mistakes

Mistake:Treating a removed response enum value as breaking because the old list was longer.

Fix:For responses, shrinking the value set is compatible: clients only see values they already understand. Adding a value is the breaking direction.

Mistake:Assuming a changed server URL is cosmetic.

Fix:Server and host/basePath changes relocate every endpoint and are reported as breaking for all clients.

Mistake:Ignoring path-item parameters when reviewing an operation.

Fix:Operations inherit path-level parameters and can override them by in:name. The tool merges both before diffing so a moved parameter does not appear as an unrelated add/remove pair.

Mistake:Believing security: [] disables authentication entirely for the API.

Fix:It is an opt-out for one operation from the root security requirement. The tool resolves effective security per operation and reports new requirements as breaking.

Mistake:Comparing two specs by raw text and counting every reformat as a break.

Fix:This tool walks the semantic model: key order, formatting and comments do not produce findings, while structural compatibility changes do.

Frequently asked questions

What counts as a breaking change?

A change that can invalidate an existing client. On the request side that includes a newly required parameter or property, a removed parameter, a narrowed type, a shrunk enum, or closing additionalProperties. On the response side it includes a removed endpoint, status or header, a new enum value, a wider numeric type, added nullable, a new oneOf/anyOf branch, or a changed server URL. Each finding explains its rationale and carries a stable rule id so you can dispute or disable it.

Does it handle $refs?

Yes. Internal $refs are resolved with memoization before comparison, including refs into definitions/components and recursive schemas. Cycles are detected and compared by reference identity with an explicit note, because a fully recursive structural diff cannot terminate. External $ref files are never fetched: they are skipped, counted, and compared by reference identity; two identical refs produce no finding.

Can I diff OpenAPI 2.0 against 3.x?

Yes. A version-mismatch chip is shown and both documents are mapped to a common 3.x model first. Swagger 2.0 definitions become components.schemas, in:body and formData parameters become requestBody content, collectionFormat becomes style/explode, host/basePath/schemes become servers, type:file becomes a binary string, x-nullable becomes nullable, and securityDefinitions become securitySchemes. The 2.0 body required flag maps to requestBody.required and is included in the rules.

How is the semver suggestion decided?

Any breaking finding suggests MAJOR. If there are no breaking findings but at least one compatible-additive change, the suggestion is MINOR. Documentation-only changes such as description, title, example or deprecation metadata suggest PATCH. Identical specs suggest NONE. Findings hidden by ignore rules are removed before the counts and suggestion are computed.

Can I gate CI on this?

Yes. Copy or download the JSON report: it contains the summary, versions, stats and every finding with its rule id, severity, JSONPaths and explanation. Fail the job when summary.breaking is greater than zero. Export the ignore rules your reviewer used alongside the report so the CI verdict matches the review verdict.

Why is a new response enum value breaking but a removed one safe?

Clients were compiled or generated against the old set. A value they have never seen can hit an exhaustive switch or a validation check and fail. Removing a value only narrows what the server can return, so existing client code still understands every remaining value. The request direction is the mirror image: clients may still send a removed value, while a new accepted value is harmless.

Are path-level parameters and root security taken into account?

Yes. Operation parameters are merged from the path item and the operation, with the operation's in:name key overriding the inherited one. Effective security is resolved per operation from the document root, with an explicit security: [] opt-out, so a root-level auth change is reported on each affected operation instead of being invisible.

Does my specification leave the browser?

No. Parsing, dereferencing, comparison and exports all happen in this tab; there is no upload or network request. Only ignore preferences are stored in localStorage. The two specification texts are never persisted.

References & standards