Skip to main content

SchemaWatch

Detect breaking API changes before they reach production. Works with any OpenAPI file — just run one command.

PyPI CI Python License Stars


🎬 Demo

SchemaWatch Demo

python -m schemawatch.cli examples/old.yaml examples/new.yaml

🚀 What is SchemaWatch?

SchemaWatch compares two OpenAPI schemas and detects breaking API changes automatically.

It is designed to be:

  • ⚡ Simple
  • ⚡ Fast
  • ⚡ CI/CD friendly

🚀 Features

SchemaWatch detects:

  • Removed endpoints
  • Removed HTTP methods
  • Removed schemas
  • Removed response fields
  • Field type changes
  • Fields that became required
  • Enum value changes
  • Array item type changes
  • $ref resolution for components.schemas and request/response bodies

How reporting works

SchemaWatch checks breaking changes at two levels:

  1. Component schemas (components.schemas) — e.g. Response field removed: User.email
  2. Operations (per path/method) — e.g. request body removed, response status removed

When a request or response body is only a $ref to a component schema (e.g. #/components/schemas/User), field-level changes are reported once at the schema level, not again as Response body field removed: GET /users 200.email. Inline body schemas (no $ref) are still reported at the operation level.


📦 Installation

pip install schemawatch

⚙️ Usage

# Basic usage
python -m schemawatch.cli examples/old.yaml examples/new.yaml

# JSON output
python -m schemawatch.cli examples/old.yaml examples/new.yaml --format json

# Markdown output
python -m schemawatch.cli examples/old.yaml examples/new.yaml --format markdown

# Save to file
python -m schemawatch.cli examples/old.yaml examples/new.yaml --format json --output result.json

# Quiet mode (CI use)
python -m schemawatch.cli examples/old.yaml examples/new.yaml --quiet

🧑‍💻 Real-world usage

python -m schemawatch.cli openapi_old.yaml openapi.yaml
python -m schemawatch.cli api/v1/openapi.yaml api/v2/openapi.yaml

🧪 Example Output

====================================
🚨 SchemaWatch Report
====================================

Breaking changes detected: 5

── CRITICAL (2)
🔴 Endpoint removed: /orders
🔴 Method removed: GET /users

── WARNING (3)
🟡 Response field removed: User.email
🟡 Field type changed: User.id integer -> string
🟡 Field became required: User.id

------------------------------------
Summary:
- Total changes: 5
- Critical: 2
- Warning:  3
- Info:     0
------------------------------------

🔁 CI/CD Integration

SchemaWatch is designed to run in CI pipelines.

python -m schemawatch.cli openapi_old.yaml openapi.yaml
  • Exit code 1 → breaking changes detected ❌
  • Exit code 0 → no breaking changes ✅

⚙️ GitHub Actions Example

- name: Check API breaking changes
  run: python -m schemawatch.cli openapi_old.yaml openapi.yaml

💬 PR Comment Integration

Automatically comments on pull requests:

⚠ Breaking API changes detected:

🔴 Endpoint removed: /orders
🟡 Field type changed: User.id integer -> string

🤔 Why not oasdiff / openapi-diff?

Feature SchemaWatch oasdiff / openapi-diff
Easy CLI ✅ Very simple ⚠️ More complex
CI/CD friendly ✅ Built-in mindset ⚠️ Needs config
PR comments ✅ Yes ❌ Not built-in
Severity levels ✅ Critical/Warning/Info ❌ Not built-in
Output ✅ Clean & readable ⚠️ Verbose
Setup time ⚡ 10 seconds ⏱️ Longer

SchemaWatch = quick setup + practical usage


🛠 Roadmap

  • Request body change detection
  • Response status code comparison
  • $ref resolution (#/components/... internal pointers)
  • Nested object comparison improvements (allOf / oneOf, external file refs)
  • Markdown output (--format markdown)
  • HTML output
  • Web dashboard

🤖 AI-Powered Explanations (Experimental)

SchemaWatch can use Gemma 4 to explain breaking changes in plain English.

python gemma_explainer.py

Requires a Google AI Studio API key:

  1. Get your free API key from Google AI Studio
  2. Create a .env file: GEMINI_API_KEY=your_key_here
  3. Run: python gemma_explainer.py

🤝 Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Open a pull request

📄 License

This project is licensed under the MIT License.

Metadata

Release files for schemawatch 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for schemawatch 0.1.4
File Size Uploaded Provenance
schemawatch-0.1.4.tar.gz 12.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for schemawatch 0.1.4
File Interpreter ABI Platform
schemawatch-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 22.4 kB

Release files / schemawatch-0.1.4.tar.gz

Download URL schemawatch-0.1.4.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c60d0b31fcff1883bc664aee1e1731f2a338f3b60b6e09a8675910595bfc0115
BLAKE2b-256 checksum
How to use checksums
4fd7a42469eed2ae9fa8bbadd525692b44e4aead94da6b770748549417ccfab4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / schemawatch-0.1.4-py3-none-any.whl

Download URL schemawatch-0.1.4-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c4ca3023c8916452101591c7aea01c105018e637f3d8664df81dc07dd67a429e
BLAKE2b-256 checksum
How to use checksums
7cc396db66c1c7b6c5a1664072272b36aa1ebf13eae7415446300334cace8cee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Security for schemawatch 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for schemawatch-0.1.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page