Compare a microservices API

When your API is made of several microservices, each with its own OpenAPI spec behind one gateway, oasdiff compares the whole set at once instead of a single pair of specs. You name each side with a glob and oasdiff diffs the two collections as one API. It works for any API split across multiple files, and the microservices-behind-a-gateway case is what it is built for.

Compare the whole set

Pass --composed and a glob for each side. Quote the glob so your shell passes the * through to oasdiff rather than expanding it.

oasdiff breaking --composed "base/*.yaml" "revision/*.yaml"

The same works for changelog, for the full list of changes rather than only the breaking ones:

oasdiff changelog --composed "base/*.yaml" "revision/*.yaml"

Open a side-by-side review

Add --open to render the changes across every service as a side-by-side review in your browser, each change grouped under the service and the source block it came from.

oasdiff changelog --composed "base/*.yaml" "revision/*.yaml" --open

Good to know

  • It compares paths and endpoints across the set. Other resources are compared only when a path or endpoint references them.
  • Path prefix modification is not applied when comparing across multiple services.
  • Quote or escape any glob that contains a *, so your shell hands it to oasdiff intact.