Detect breaking API changes between OpenAPI schemas
Project description
SchemaWatch
Detect breaking API changes before they reach production. Works with any OpenAPI file — just run one command.
🎬 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
📦 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
- Nested object comparison improvements
- Markdown / HTML output
- Web dashboard
🤝 Contributing
Contributions are welcome!
- Fork the repository
- Create a feature branch
- Commit your changes
- Open a pull request
📄 License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file schemawatch-0.1.1.tar.gz.
File metadata
- Download URL: schemawatch-0.1.1.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e06d6bcb82152f9e55692de3d9f74ef4384b78567eef25e5999f8bb800b6986
|
|
| MD5 |
d54e5fe386a8c0911ad97315bf95e3cf
|
|
| BLAKE2b-256 |
0d37d8a9fc6a595d5b3637496f01d47357792ca746d6f6e09015ebae2bc749ec
|
File details
Details for the file schemawatch-0.1.1-py3-none-any.whl.
File metadata
- Download URL: schemawatch-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4969742c9de6232c23b450f5717a4d37d831a236a6cc62875fa767d3f96cbc8
|
|
| MD5 |
54658fc4b7fc422f8fe69715f9ef5089
|
|
| BLAKE2b-256 |
25652531cf3ba4644f04826a8fe9b00b5d888a62f44147f2a4cbaaf62f68333a
|