Small Tools

API · Developer Guide

How to Detect Breaking Changes in OpenAPI

A small contract edit can force a deployed client to change. Review the old and new specifications together, then test the requests and responses that consumers actually depend on.

What makes an API change breaking?

A breaking change makes a previously supported client interaction fail or changes a result the client relies on. OpenAPI records part of that contract: operations, parameters, request bodies, responses, and schemas. It cannot capture every behavioral dependency.

Compatibility is directional. Review an old consumer against the proposed server, rather than asking whether two documents are simply different. Decide which consumers and documented behaviors your compatibility policy promises to support.

  • Removing GET /users can break a client that still calls that operation.
  • Requiring a previously optional query parameter or request property can reject requests that omit it.
  • Removing a response property can break a consumer that reads it; narrowing accepted request values can reject inputs that previously worked.
  • An added response field may be harmless to a tolerant reader but rejected by a strict decoder. Check your consumers instead of treating every addition as automatically safe.

How to compare two specifications

  • Save the released contract as the source and the proposed contract as the target. Record the artifact or commit for each; do not substitute an unrelated branch or an unreleased baseline.
  • Check syntax and selected structure with OpenAPI Validator. A successful result is not complete version-specific validation.
  • Paste the two complete YAML or JSON documents with === TARGET === on its own line between them. Reversing the documents reverses additions and removals.
  • Run OpenAPI Diff to inventory inline operation additions, removals, and edits. A Changed line does not classify compatibility.
  • Run Breaking Change Checker for selected warnings, Schema Diff for named component changes, and Migration Report for a combined operation, schema, version, and server summary.
  • Inspect referenced definitions and unsupported rules separately, identify affected consumers, and run representative contract and integration tests before deciding whether to release.

Example: removing an endpoint

The source below exposes GET /users. The target removes it. OpenAPI Diff reports Removed: GET /users; the breaking change checker reports Breaking change: GET /users was removed.

Input for the comparison tools
openapi: 3.0.3
info:
  title: Example API
  version: "1.0"
paths:
  /users:
    get:
      responses:
        "200":
          description: Users returned
=== TARGET ===
openapi: 3.0.3
info:
  title: Example API
  version: "2.0"
paths: {}

Example: requiring another request property

Both versions below require a request body and the sku property. Only the target adds currency to the schema's required list. A caller sending just {"sku":"SKU-7"} would need to change if the server enforces the proposed contract.

Paste the whole pair into OpenAPI Diff to get Changed: POST /orders. Breaking Change Checker reports Breaking change: POST /orders newly requires request property currency. This example uses an inline schema; a referenced schema would require separate review.

Input for the comparison tools
openapi: 3.0.3
info: {title: Orders API, version: "1"}
paths:
  /orders:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [sku]
              properties:
                sku: {type: string}
                currency: {type: string}
      responses:
        "201": {description: Order created}
=== TARGET ===
openapi: 3.0.3
info: {title: Orders API, version: "2"}
paths:
  /orders:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [sku, currency]
              properties:
                sku: {type: string}
                currency: {type: string}
      responses:
        "201": {description: Order created}

Common mistakes

  • Comparing implementation branches without keeping a released baseline: consumers may still use an older deployed contract.
  • Treating every Changed line as a break: documentation edits or serialized object-key ordering can change an operation report without changing behavior.
  • Ignoring an added required query parameter or request field: existing clients might not send it.
  • Assuming a successful structural check proves full OpenAPI compliance or runtime compatibility: those are separate checks.

Limitations of these local checks

The tools inspect inline operations and selected schema differences. They do not fetch external references, fully resolve $ref relationships, or model every composition, serialization, security, and compatibility rule. The basic validator checks common document structure rather than the complete specification.

The breaking change checker reads operation-level parameters, not inherited path-level parameters, and checks required request properties in the first inline media schema with a required array. It does not expand referenced request schemas. A warning needs investigation; a 'no common breaking changes' result is a starting point for review. Inspect referenced schemas, authentication changes, enum restrictions, response types, and client code; supplement the review with a contract checker and integration tests suited to your API.

Record a decision in the pull request

A report is review evidence, not an automatic release gate. For every potential break, record which requests or consumers depend on the old behavior, who reviewed the impact, and whether migration or deprecation work is required. Small Tools does not connect to your repository or run in your CI pipeline.

Copyable review note
API contract review
Baseline artifact / commit:
Proposed artifact / commit:
Affected operations and consumers:
Findings and compatibility decision:
References / unsupported rules reviewed:
Migration or deprecation plan:
Contract / consumer test results:
Reviewer and release decision:

Frequently asked questions

Is a textual diff enough? No. OpenAPI Diff compares serialized inline operations, so key ordering can produce Changed and component-only edits can be missed. Use Schema Diff for named components and review their actual constraints.

Does No common breaking changes found mean I can release? No. The checker does not classify response field or type changes, enum restrictions, security changes, or all serialization rules. Consumer tests and your compatibility policy still determine the decision.

Does changing info.version prove a breaking change? No. That field is contract metadata; it does not establish runtime behavior or classify compatibility. Review the changed operations and schemas regardless of the version label.

Practical use cases and security

Include a saved before/after contract in release review, identify affected operations, and document migration steps for each consuming client. For a removed endpoint, plan a replacement and deprecation period before deployment.

The comparison runs locally and does not contact the servers listed in the specification. Remove embedded example credentials and private infrastructure names before sharing the resulting report.

Related tools

Browse OpenAPI & API tools →

References

Browse all developer guides →