- Updated service template structure in `ARCHITECTURE.md` and `README.md` for clarity and usability. - Enhanced bilingual documentation across skills, increasing the number of available skills from 15 to 25. - Added new sections on event-driven architecture, inter-service communication, and performance optimization. - Improved formatting and removed outdated references to streamline the documentation experience.
1.3 KiB
1.3 KiB
name, description
| name | description |
|---|---|
| api-versioning-strategy | API versioning strategies for GoodGo microservices including semantic versioning, backward compatibility patterns, API deprecation, version negotiation, and breaking changes handling. |
API Versioning Strategy
When to Use This Skill
Use this skill when:
- Versioning APIs
- Handling breaking changes
- Implementing API deprecation
- Maintaining backward compatibility
- Implementing version negotiation
Key Patterns
URL Path Versioning
// Version routes
router.use('/v1', v1Router);
router.use('/v2', v2Router);
Header-Based Versioning
// Version negotiation
const acceptHeader = req.headers.accept;
const version = acceptHeader.match(/application\/vnd\.goodgo\.v(\d+)\+json/)[1];
Deprecation
// Deprecation headers
res.setHeader('Deprecation', 'true');
res.setHeader('Sunset', '2024-12-31');
res.setHeader('Warning', 'API version 1 is deprecated');
Best Practices
- Choose versioning strategy and be consistent
- Use semantic versioning (MAJOR.MINOR.PATCH)
- Always deprecate before removing
- Provide migration guides
- Maintain backward compatibility when possible
Resources
- API Design
- Skill Source:
.cursor/skills/api-versioning-strategy/SKILL.md