oasdiff is a free, open source api development & testing project written in Go and released under Apache-2.0. It has 1,371 GitHub stars, 107 forks and 50 open issues, and was last pushed 41 hours ago. On this registry it ranks #137 of 182 tracked projects in API Development & Testing, with 5 head-to-head comparisons available.

What is oasdiff?

oasdiff is a Go-based, Apache-2.0 command-line tool that compares OpenAPI specifications and detects breaking changes, built for API engineers and platform teams who need to know whether a spec edit will break existing API clients before it ships.

What it is

oasdiff lives in the OpenAPI tooling ecosystem and ships as a single Go binary with no server component. It compares two OpenAPI specs and classifies every difference between them through the subcommands breaking, changelog, and diff, and it also processes a single spec through validate, upgrade, and flatten. Around that core it adds git integration through breaking-files and git-diff-driver, a companion GitHub Action, and a hosted PR review workflow at oasdiff.com that approves or rejects each change with a CI commit status.

The concrete problem it solves is spec review by hand or by generic textual diff. A plain text diff cannot tell a team that a reworded description is harmless while a narrowed type or a removed response code will break callers, so reviewers either read the whole document or miss the breaking edit. oasdiff replaces that manual reading by classifying each change: changelog reports the changes that can affect API consumers, breaking or not; breaking narrows the report to changes that break existing API clients; diff returns the full machine-readable diff of the API definition, including documentation-only edits, in html, json, markdown, markup, text, or yaml. It also fits into the reviewer's existing git and CI habits rather than asking for a new review tool.

Key capabilities

  • breaking lists only changes that break existing API clients, while changelog lists all changes that can affect API consumers in human-readable form.
  • diff emits the full diff of the API definition in html, json, markdown, markup, text, or yaml (yaml by default), and summary gives a high-level count of changes built on the same diff engine.
  • validate checks one spec for per-RFC violations such as invalid types, missing required fields, bad regex, and unresolved $refs.
  • upgrade canonicalizes an OpenAPI 3.0 spec to the latest 3.x, and flatten replaces allOf schemas with a merged equivalent.
  • breaking-files checks a list of changed specs against their versions in a git ref, one comparison per spec, and is used by the documented pre-commit hook.
  • git-diff-driver runs as a git external diff driver so that git log --patch renders an OpenAPI changelog inline.
  • checks changelog and checks validate list the classification rules, which can be customized, checks changelog coverage maps every possible OpenAPI edit to the checks that cover it, and schema prints a JSON Schema for breaking and changelog.

Who uses it and how

  • CI pipelines that run the companion GitHub Action on pull requests, so every spec change gets a breaking-change verdict before merge.
  • Teams that review API changes in the hosted workflow at oasdiff.com, approving or rejecting each individual change and recording the decision as a CI commit status.
  • Local development, where the documented one-liner runs the tufin/oasdiff Docker image against two specs and prints a changelog without any installation.
  • Version-control-centric teams that install the pre-commit hook backed by breaking-files, or set git-diff-driver as the external diff driver and read the changelog directly in git log --patch.
  • Maintainers of specs that have drifted on schema style, who run upgrade to canonicalize a 3.0 document or flatten to collapse allOf compositions.

Getting started

Install with go install github.com/oasdiff/oasdiff@latest, or with brew install oasdiff, the curl-based install.sh script, asdf, or a pre-built binary for macOS, Linux, or Windows on x86_64 and arm64. To run without installing, use the Docker image tufin/oasdiff, as in docker run --rm -t tufin/oasdiff changelog against two specs.

How it compares

The provided facts name no paid products that oasdiff replaces and no comparable tools, so it stands alone in this registry. There is no licence, hosting, or pricing contrast to draw here, only the Apache-2.0 CLI, the GitHub Action, and the optional hosted workflow on its own homepage.

When to use it — and when not to

The facts describe no database, object storage, or SMTP requirement, so a self-hoster runs a single binary and, at most, a container image. It is a poor fit for teams that do not keep OpenAPI specs in git or have no CI pipeline to attach the check to, and the facts show no Swagger or OpenAPI 2.0 handling, only 3.0-to-3.x conversion through upgrade. The README excerpt also stops mid-sentence in the command reference for schema, so parts of the documentation still read as incomplete.

project readme (upstream, from github) — read inline

CI codecov Go Reference Docker Image Version

oasdiff banner

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.

Get started in 30 seconds

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.yaml

That 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.

Installation

Install with Go

go install github.com/oasdiff/oasdiff@latest

Install on macOS with Brew

brew install oasdiff

Install on macOS and Linux using curl

The install.sh script downloads the latest oasdiff binary into /usr/local/bin:

curl -fsSL https://raw.githubusercontent.com/oasdiff/oasdiff/main/install.sh | sh

To pin a specific version, set the version env var:

curl -fsSL https://raw.githubusercontent.com/oasdiff/oasdiff/main/install.sh | version=1.11.7 sh

Install with asdf

https://github.com/oasdiff/asdf-oasdiff

Download a binary

Pre-built binaries for macOS, Linux, and Windows (both x86_64 and arm64) are on the releases page.

Documentation

Grouped by what you're trying to do. New to oasdiff? Start with Commands.

Commands

The top-level subcommands, grouped as in oasdiff --help.

Compare two specs

  • breaking — only the changes that break existing API clients
  • changelog — changes that can affect API consumers, breaking or not, in human-readable form
  • diff — 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.x
  • flatten — replace allOf schemas with a merged equivalent

Git 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 hook
  • git-diff-driver — run as a git external diff driver so git log --patch renders an OpenAPI changelog inline

Reference

Inputs

Where specs come from.

  • Git revisions — compare against a branch, tag, or commit
  • Local files, http/s URLs, YAML or JSON — all handled transparently

Comparison

How oasdiff pairs up base and revision and what counts as a difference.

Normalization

Align each spec before diffing so equivalent things line up.

API lifecycle

Communicate intent across versions.

Filtering changes

Choose which kinds of differences are reported.

Output

Shape and enrich the report.

How to run

Reference

Demo

Credits

This project relies on the excellent implementation of OpenAPI 3.0 and 3.1 for Go: kin-openapi.

Feedback

We welcome your feedback.
If you have ideas for improvement or additional needs around APIs, please let us know.

Frequently asked questions

Is oasdiff free to use?

oasdiff is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does oasdiff do?

OpenAPI Diff and Breaking Changes

What is oasdiff written in?

oasdiff is primarily written in Go. Its source is publicly available at https://github.com/oasdiff/oasdiff, and it has 1,371 GitHub stars.