# OpenAPI Break Check

> Compare two OpenAPI or Swagger JSON files and list what breaks existing clients, one row per change with operation and both JSON pointers; each rule with a safer pattern; exit 1 on BREAKING for CI; says what it could not compare, and never passes when it compared less than half of the path items.

OpenAPI Break Check is a paid AI agent skill on Agensi by Hale Sinclair, in APIs & Backend. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $7 (one-time purchase)
- Creator: [Hale Sinclair](https://www.agensi.io/creators/hale-sinclair)
- Category: [APIs & Backend](https://www.agensi.io/skills/apis-backend)
- Version: 1.0
- Last updated: 2026-12-01
- Security: scan passed (2026-12-01); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/openapi-break-check
- Tags: api, code-review, testing, openapi, swagger, breaking-changes, api-versioning, ci-gate

## About this skill

### The problem
A change to an API description that looks small can break every client: a new required query parameter, a response field that disappears, an enum value taken out of a request, a status code that is no longer returned. They are easy to miss in a long diff of YAML or JSON, and a checker that skips what it cannot read often does so silently.

### What it does
Your agent runs one standard-library Python script over two versions of an OpenAPI 3.0, 3.1 or Swagger 2.0 document (JSON) and explains the result. Operations are matched by method and path (a renamed `{param}` still matches); every schema is followed through `$ref` and `allOf`, so a change in a shared schema is one row that says how many operations reach it (`xN`) and names the first. One row per fact per place it is reached from (see Known limitations): the rule, the operation, the JSON pointer in each document and what changed, with a class:
- **BREAKING**: a client written for the old version can fail: a required parameter, field or body added; an operation, response field, status code, media type or header removed; a type or enum narrowed in a request; a limit tightened; security added.
- **REVIEW**: needs a person: an enum widened in a response, a parameter that moved into the body, a response field that became optional.
- **SAFE**: additive, or a loosening a client cannot trip on.

Each rule that fires comes with what happens to a client and a safer pattern (add it as optional, deprecate before removing, version the path); the agent explains each BREAKING row and who is affected. `--json` gives a CI gate: exit 0 PASS, exit 1 BREAKING, INCOMPLETE or NOTHING COMPARED, exit 2 a usage error. A run that compared nothing (two documents with no paths, no operation in common, every path an external `$ref`) says NOTHING COMPARED, and one that could compare less than half of the path items says INCOMPLETE n of m: neither is ever PASS, and any verdict says `(n of m paths compared)` when a path item was skipped. It reads JSON only (convert YAML first); no server is called, no network, and it writes only the `--out` file you name.

### What you get that prompt-only skills don't
- **The rules are a table, not memory.** The same pair gives the same rows every time; the 42 rules are data the check tests one by one, each rule's example firing it and only it.
- **What was not compared is counted and named**, with its document and JSON pointer: external `$ref`s, branches that differ, `not`, links, a renamed operationId. A row that is missing is never presented as proof that nothing changed.
- **Read on real specs, not only on a demo.** Three real pairs of other projects were compared whole, rows were read by hand against the projects' own change histories, and the count of the changes they name that the tool does not show is in the table below.
- **A CI exit code**, and the list of rules to cite when a breaking change is on purpose.

### Next to the OpenAPI diff skills already listed
Their own listing words, and what this one does about each:
- *openapi-breaking-changes-diff-two-specs-before-release*: "No YAML or OpenAPI 2.0 support." Swagger 2.0 is read here (the Docker pair below is one); YAML is not read either: the script says so in one line and exits 2.
- *api-change-report-what-may-break-from-two-specs*: "It compares two description files and does not call the API, so behaviour the description does not state is outside its view." Here SKILL.md tells the agent to say so in every report, and what the script itself did not read is printed as a not-compared list with its place, not left out.
- *openapi-consumer-impact-breaking-change-gate*: "No remote references, YAML, exhaustive OpenAPI conformance claim, code generation, CI modification, deployment or runtime traffic analysis." Here an external `$ref` is not followed either, but it is listed with its place and counted: when most path items are external the verdict is INCOMPLETE, not PASS. YAML is refused in one line. It has no list of consumers: it says what changed, the agent asks who is affected.

### Why pay $7 when oasdiff is free
oasdiff is free, reads YAML and follows external `$ref`s; this script reads JSON only and follows local `$ref`s only, so if your spec is YAML or split across files and you can install a tool, use oasdiff; it also compares keywords this script only lists as not compared (format, const, discriminator, multipleOf, uniqueItems). What you pay for here, each proved by the check: nothing to install (one file, Python's standard library, run alone in an empty folder); a list of what it did not compare, with the place; a verdict that is never PASS when nothing, or less than half of the path items, was compared; and every row explained by your agent with a safer pattern.

### How it works
- The agent finds the two documents (the released one and the one under review, for example `git show origin/main:openapi.json`), converts YAML if needed, and runs the script.
- It reads the verdict and the counts, then each BREAKING and REVIEW row, and the whole not-compared list.
- For each BREAKING row it says in plain words what a client sees, who is affected and the safer pattern; it never edits the spec to make a verdict pass.

### What was checked, and how
Every number here is read from the check's own output (`check.out`) when this page is written.
- **240 regression cases** (paths and exit codes, the compare-nothing gate, BOM, CRLF, non-UTF-8, `\u` escapes, key order, versions 3.0, 3.1 and 2.0, renamed `{param}`, local `$ref` with `~0`, `~1` and loops, schemas, security), each shown failing on at least one of 207 deliberately broken copies of the script or the rule table.
- **42 rules as a data table**, equal to the script both ways.
- **Three real pairs of other projects**, the documents reduced to named paths (inputs/SOURCES.md): Docker Engine API (Swagger 2.0), Zulip (OpenAPI 3.0) and Discord (OpenAPI 3.1).

| pair | format | operations compared | BREAKING | REVIEW | SAFE | not compared |
|---|---|---|---|---|---|---|
| Docker Engine, 1.43 to 1.44 | Swagger 2.0 | 107 | 3 | 3 | 19 | 0 |
| Zulip, 8.0 to 9.0 | OpenAPI 3.0.1 | 60 | 8 | 144 | 45 | 4 |
| Discord, two commits | OpenAPI 3.1.0 | 68 | 6 | 1 | 0 | 0 |

On those pairs, 9 faithful re-encodings of both documents (keys reversed, no whitespace, tabs, CRLF, BOM, `\u` escapes, one line, through YAML and back) changed no row; 16 one-fact changes (a parameter made required, a status removed, a type changed, security removed ...) each changed the result as named; of 44 rows read by hand, 42 were right, 0 wrong and 2 debatable. Of the 21 changes those projects name in their own change histories, 13 have no row (62 percent): see Known limitations.

### Known limitations
- Structure only: descriptions, summaries, examples, `deprecated` flags and `default` values are not compared. On the three real pairs, 13 of 21 changes the projects name had no row for that reason (deprecation notes, description-only changes, a filter inside a JSON-string parameter, an enum value added to a parameter that moved into the body). A missing row is not proof that nothing changed.
- It reads the description, not the server: behaviour a spec does not state, and clients that use fields it never listed, are not seen.
- JSON only; external `$ref`s, `not`, callbacks, webhooks, a oneOf or anyOf whose branches differ in count and a schema given on one side only are listed as not compared, not read; so are changed `format`, `const`, `discriminator`, `multipleOf` and `uniqueItems`, which oasdiff does compare. A nullable written as `nullable: true` in one document and as an `anyOf` or `type` array with null in the other is read as one fact.
- A nullable written as anyOf/oneOf [X, {"type": "null"}] is read as X merged through allOf: a row inside X shows .../allOf/0/... where the document has .../anyOf/N/... (N is the non-null branch), and a null added or removed around a $ref is shown at the referenced schema's /type; the change itself is at the anyOf/oneOf in the operations the row counts, and one such row can stand for several of them.
- A fact reached through a nullable wrapper or a shared response can appear as one row per place it is reached from; the BREAKING count is of rows, not facts.
- PASS can stand beside a long not-compared list of schemas: the less-than-half rule counts path items only.
- Reordering servers gives no row, though generated clients use the first one.
- Its classes are a position, not the only one: a second tool (oasdiff, checked on the three real pairs and on the example of every rule) calls a response field that became optional, a widened response enum, a relaxed response limit and a request body no longer accepted errors where this script says REVIEW, and calls a removed optional response field, a removed non-success status, a removed optional header, a response type change, security removed and a new non-success status info or REVIEW where this script says BREAKING or REVIEW; a query parameter this script reads as moved into the body it reads as removed with a deprecation, and a request parameter that goes from a string to an array of strings (BREAKING here) it calls widened, info. Read every REVIEW row; do not gate a release on the BREAKING count alone if your clients read the response with no guard.
- A run takes about a minute for a large spec (Stripe's, 8 MB: about 80 seconds and 75 MiB of memory here); a small one takes well under a second.
- The tool cannot tell a deliberate breaking release from a mistake; two rows in the Docker pair (legacy `ClusterStore` and `ClusterAdvertise` removed) were judged debatable by hand.

## Requires

- Python
- Git

No accounts, API keys, database connection or services. Python 3.9+ on the machine.

## Known limitations

Structure only: descriptions, examples, deprecated flags and default values are not compared, so on three real pairs 13 of the 21 changes the projects name had no row (62 percent); a missing row is not proof that nothing changed. It reads the spec, not the server. JSON only (YAML is refused in one line, exit 2); about a minute for a large spec (8 MB: about 80 seconds). External $ref, not, callbacks, webhooks, links, a schema given on one side only and branches that differ are listed as not compared, and so are changed format, const, discriminator, multipleOf and uniqueItems, which oasdiff does compare; a nullable written two ways is one fact. Its classes are a position, not the only one: a second tool (oasdiff, checked on the three real pairs and on the example of every rule) calls a response field that became optional, a widened response enum, a relaxed response limit and a request body no longer accepted errors where this script says REVIEW, and calls a removed optional response field, a removed non-success status, a removed optional header, a response type change, security removed and a new non-success status info or REVIEW where this script says BREAKING or REVIEW; a query parameter this script reads as moved into the body it reads as removed with a deprecation, and a request parameter that goes from a string to an array of strings (BREAKING here) it calls widened, info. Read every REVIEW row; do not gate a release on the BREAKING count alone if your clients read the response with no guard. a change of server variables is one changed-server row, and the pointer of a response-status-added row on a shared response names the component, not the path. Two Docker rows of the 44 read by hand were debatable (legacy fields removed from the spec). The tool cannot tell a deliberate breaking release from a mistake.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the OpenAPI Break Check skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Does it call my API or need the server?

No. It reads the two files as text, opens no socket and runs no program. That is also why it cannot see what a server does that its spec does not say: SKILL.md tells the agent to say so.

### What does PASS mean?

That none of the 42 rules found a BREAKING row in the operations it compared. It is not a promise that clients cannot break: read the not-compared list every time. A run that compared nothing says NOTHING COMPARED and one that compared less than half of the path items says INCOMPLETE n of m; both exit 1.

### My spec is YAML. Does it work?

Not directly: the script reads JSON and says so in one line (exit 2). Convert it first, for example with yq or the tool that generates the spec, then run it on the two JSON files.

### Does it follow $ref?

Local references (#/components/...) are followed, with loops compared once, and a change in a shared schema is one row with the number of operations that reach it. External references are listed as not compared with their place; bundle a split spec first.

### Can I use it as a CI gate?

Yes: the exit code is 0 on PASS and 1 on BREAKING, INCOMPLETE or NOTHING COMPARED, and --json gives every row. Compare the released spec (for example git show origin/main:openapi.json) with the one in the pull request.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
