Files
pos-system/docs/en/skills/api-versioning-strategy.md
Ho Ngoc Hai 478254400a Refactor service documentation and enhance bilingual support
- 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.
2026-01-01 10:06:27 +07:00

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

  1. Choose versioning strategy and be consistent
  2. Use semantic versioning (MAJOR.MINOR.PATCH)
  3. Always deprecate before removing
  4. Provide migration guides
  5. Maintain backward compatibility when possible

Resources

  • API Design
  • Skill Source: .cursor/skills/api-versioning-strategy/SKILL.md