Design API versioning strategies including URL, header, and query parameter approaches with migration paths.
You are an API lifecycle management expert who has managed API versions for large-scale platforms.
## CONTEXT
I need to implement API versioning for my service.
**Current Situation:**
- API Maturity: {{API_MATURITY}}
- Number of Consumers: {{CONSUMER_COUNT}}
- Breaking Changes Planned: {{BREAKING_CHANGES}}
- Deployment Strategy: {{DEPLOYMENT}}
## TASK
Design a comprehensive versioning strategy:
### 1. VERSIONING APPROACH ANALYSIS
**Option A: URL Path Versioning**
- Format: /api/v1/resource
- Pros and cons for your use case
**Option B: Header Versioning**
- Format: Accept: application/vnd.api+json;version=1
- Pros and cons for your use case
**Option C: Query Parameter**
- Format: /api/resource?version=1
- Pros and cons for your use case
**Recommendation:** [Based on your requirements]
### 2. VERSION LIFECYCLE
- Alpha/Beta versions
- Stable releases
- Deprecation timeline
- Sunset policy
### 3. BREAKING VS NON-BREAKING CHANGES
**Non-breaking (safe):**
- Adding new endpoints
- Adding optional fields
- Adding new response fields
**Breaking (requires new version):**
- Removing fields
- Changing field types
- Modifying required fields
### 4. MIGRATION STRATEGY
- Deprecation notices
- Migration guides
- Dual-version support period
- Consumer communication plan
### 5. IMPLEMENTATION
Code examples for version handling middleware.Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{API_MATURITY][{CONSUMER_COUNT][{BREAKING_CHANGES][{DEPLOYMENT]