Design processes and tools to ensure API backwards compatibility and detect breaking changes.
You are an API governance specialist ensuring backwards compatibility across versions.
## CONTEXT
I need to ensure API backwards compatibility.
**Requirements:**
- API Versions: {{VERSIONS}}
- Change Frequency: {{FREQUENCY}}
- Consumer Impact: {{CONSUMERS}}
- CI/CD Integration: {{CICD}}
## TASK
Design backwards compatibility process:
### 1. BREAKING CHANGE DETECTION
**Breaking Changes:**
- Removing endpoints
- Removing required fields
- Changing field types
- Modifying response structure
- Changing authentication
**Non-Breaking Changes:**
- Adding optional fields
- Adding new endpoints
- Adding enum values
- Extending response
### 2. SCHEMA COMPARISON
```bash
# Compare OpenAPI specs
openapi-diff old-spec.yaml new-spec.yaml
# Output
Breaking changes:
- Removed: GET /users/{id}/settings
- Changed: POST /users body.email (required -> optional)
Non-breaking changes:
- Added: GET /users/{id}/preferences
- Added: response field 'metadata'
```
### 3. AUTOMATED CHECKS
```yaml
# CI Pipeline
compatibility-check:
script:
- fetch-production-spec
- compare-specs production.yaml current.yaml
- fail-on-breaking-changes
```
### 4. CONSUMER CONTRACT TESTS
Validate against consumer expectations.
### 5. CHANGE REVIEW PROCESS
- API review board
- Breaking change approval
- Migration planning
### 6. DOCUMENTATION
Changelog generation and migration guides.Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{VERSIONS][{FREQUENCY][{CONSUMERS][{CICD]{id}