Metadata-Version: 2.4
Name: kryptorious-apiguard
Version: 1.0.0
Summary: Detect breaking changes in OpenAPI specs before they reach production
Author-email: Kryptorious <kryptorious@pm.me>
License: Proprietary
Project-URL: Homepage, https://kryptorious.gumroad.com/l/jbvet
Project-URL: Documentation, https://kryptorious.gumroad.com/l/jbvet
Project-URL: Bug Tracker, https://github.com/kryptorious/apiguard/issues
Project-URL: Repository, https://github.com/kryptorious/apiguard
Keywords: openapi,api,breaking-changes,swagger,diff,ci-cd,devops
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: click>=8.1.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"

# ApiGuard — OpenAPI Breaking Change Detector

**Detect breaking changes in your API specs before they reach production.**

ApiGuard compares two OpenAPI 3.x specifications and identifies every breaking change, non-breaking change, and deprecation — with severity levels, rule IDs, and CI-ready output.

```bash
pip install kryptorious-apiguard
```

## Quick Start

```bash
# Compare two specs
apiguard diff openapi-v1.yaml openapi-v2.yaml

# JSON output for CI pipelines
apiguard diff old.yaml new.yaml --format json

# Fail CI on any breaking change
apiguard diff old.yaml new.yaml --fail-on warning
```

## What It Detects

| Severity | Category | Examples |
|----------|----------|----------|
| 🔴 CRITICAL | Removed endpoint, removed response status, removed required path param |
| 🟠 HIGH | Changed parameter type, added required param, removed required property |
| 🟡 MEDIUM | Removed enum value, changed response property type |
| ⚠️ WARNING | Deprecated endpoint, deprecated parameter |
| ℹ️ INFO | Added endpoint, added optional param, added response field |

**30+ detection rules** covering paths, parameters, responses, request bodies, and deprecations.

## Output Formats

```bash
apiguard diff v1.yaml v2.yaml                    # Rich terminal table (default)
apiguard diff v1.yaml v2.yaml --format json      # Machine-readable JSON
apiguard diff v1.yaml v2.yaml --format markdown  # Markdown report
apiguard diff v1.yaml v2.yaml --format sarif     # SARIF (Premium)
```

## CI/CD Integration

```yaml
# .github/workflows/api-check.yml
name: API Breaking Change Check
on: [pull_request]
jobs:
  api-guard:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: pip install kryptorious-apiguard
      - run: apiguard diff main-openapi.yaml pr-openapi.yaml --format json --fail-on error
```

## Comparison

| Feature | ApiGuard | openapi-diff | Spectral |
|---------|----------|-------------|----------|
| Native Python | ✅ | ❌ (Java) | ✅ (JS) |
| Breaking change detection | ✅ Full | ✅ | ❌ (linting only) |
| Severity levels | ✅ 6 levels | ✅ 3 levels | ❌ |
| SARIF output | ✅ Premium | ❌ | ❌ |
| $ref resolution | ✅ Local | ✅ Full | ✅ |
| CI exit codes | ✅ | ✅ | ✅ |
| Install size | ~2MB | ~50MB+ | ~10MB |

## Premium

Upgrade to Premium ($9 lifetime) for:

- **SARIF output** — GitHub Advanced Security integration
- **CI annotations** — Inline PR comments on breaking changes
- **Custom rules** — Define your own breaking change policies
- **Team dashboards** — Track API stability over time
- **Priority support**

[Get Premium — $9 Lifetime](https://kryptorious.gumroad.com/l/jbvet)

## Requirements

- Python 3.9+
- Handles OpenAPI 3.0 and 3.1 specs
- Supports JSON and YAML input

## License

MIT — free for personal and commercial use. Premium features require a license.

Built by [Kryptorious Quantum Biosciences](https://kryptorious.gumroad.com).
