OpenAPI Diff and Breaking Changes
Command-line tool to compare and detect breaking changes in OpenAPI specs.
Run it locally, in CI via the GitHub Action, or use the hosted PR review workflow at oasdiff.com to approve or reject each change with a CI commit status.
No install needed — try it with Docker against two sample specs:
docker run --rm -t tufin/oasdiff changelog \
https://raw.githubusercontent.com/oasdiff/oasdiff/main/data/openapi-test1.yaml \
https://raw.githubusercontent.com/oasdiff/oasdiff/main/data/openapi-test5.yamlThat prints a human-readable changelog of the changes that can affect API consumers, breaking and non-breaking. Swap changelog for breaking to see only the changes that break existing API clients, or diff for the full machine-readable diff of the API definition, including documentation-only edits.
go install github.com/oasdiff/oasdiff@latestbrew install oasdiffThe install.sh script downloads the latest oasdiff binary into /usr/local/bin:
curl -fsSL https://raw.githubusercontent.com/oasdiff/oasdiff/main/install.sh | shTo pin a specific version, set the version env var:
curl -fsSL https://raw.githubusercontent.com/oasdiff/oasdiff/main/install.sh | version=1.11.7 shhttps://github.com/oasdiff/asdf-oasdiff
Pre-built binaries for macOS, Linux, and Windows (both x86_64 and arm64) are on the releases page.
Grouped by what you're trying to do. New to oasdiff? Start with Commands.
The top-level subcommands, grouped as in oasdiff --help.
Compare two specs
breaking — only the changes that break existing API clientschangelog — changes that can affect API consumers, breaking or not, in human-readable formdiff — full diff of the API definition, including documentation-only edits (output: html, json, markdown, markup, text, or yaml — default yaml)summary — high-level count of changes between two specs (built on the diff engine; same shared options)Process a single spec
validate — check a spec for per-RFC violations (invalid types, missing required fields, bad regex, unresolved $refs)upgrade — canonicalize an OpenAPI 3.0 spec to the latest 3.xflatten — replace allOf schemas with a merged equivalentGit integration
breaking-files — check a list of changed specs against their versions in a git ref, one comparison per spec; used by the pre-commit hookgit-diff-driver — run as a git external diff driver so git log --patch renders an OpenAPI changelog inlineReference
checks changelog — list the rules breaking and changelog use to classify changes (customize them)checks validate — list the rules validate reportschecks changelog coverage — list every possible edit of an OpenAPI document with the checks that cover itschema — print a JSON Schema for the breaking/changelog json outputWhere specs come from.
How oasdiff pairs up base and revision and what counts as a difference.
Align each spec before diffing so equivalent things line up.
allOf schemasContent-Type and content-type as the same headerCommunicate intent across versions.
Choose which kinds of differences are reported.
x-* fieldsShape and enrich the report.
https://api.oasdiff.com/mcp$ref loading to prevent SSRFThis project relies on the excellent implementation of OpenAPI 3.0 and 3.1 for Go: kin-openapi.
We welcome your feedback.
If you have ideas for improvement or additional needs around APIs, please let us know.
No open issues yet, or sync has not completed.