用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Dev-Toolbelt/dev-team-agents --skill api-versioning命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | api-versioning |
| description | API versioning — compatibility rules and deprecation lifecycle. |
Load when designing a new API, planning a breaking change, or reviewing a PR that modifies public API contracts.
| Strategy | Example | Pros | Cons |
|---|---|---|---|
| URL path | /v1/users, /v2/users | Simple; explicit; cacheable | URL pollution; hard to version individual resources |
| Query param | /users?version=2 | No URL change | Easy to ignore; pollutes query strings |
| Header | Accept-Version: 2 | Clean URL; HTTP-idiomatic | Less discoverable; harder to test in browser |
| Content negotiation | Accept: application/vnd.api+json; version=2 | Most REST-correct | Complex; vendor MIME types are opaque |
Recommended default: URL path for public APIs (simplest, most debuggable). Header versioning for internal APIs where clients are controlled.
Rule: if an existing client would break, it is a breaking change → new version required.
Deprecation and Sunset response headers/v1/*) via logsResponse headers:
Deprecation: Sat, 01 Jun 2025 00:00:00 GMT
Sunset: Mon, 01 Dec 2025 00:00:00 GMT
Link: <https://api.example.com/v2/users>; rel="successor-version"
| Client type | Minimum support | Reason |
|---|---|---|
| Web browser | 3 months | Can force update |
| Mobile app | 12-18 months | App store review delay; user adoption |
| Third-party integrations | 12 months | Enterprise change management cycles |
| Internal services | 3 months | Can coordinate deploys |
For mobile clients, track app version in User-Agent or a custom header to identify when old clients are gone.
Deprecation header as a warning log to developersRoute by version at the gateway level:
/v1/* → service:v1
/v2/* → service:v2
This enables blue/green deployment of API versions without code changes in consumers.
openapi-v1.yaml and openapi-v2.yamlx-deprecated: true extension to mark deprecated operationsoasdiff or openapi-diff in CI to detect breaking changes automaticallyDeprecation and Sunset headers added to the old version?