- name
SKILL.md
技能檔案保留在發布者的儲存庫中。
在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add rrezartprebreza/spring-boot-skills --skill api-versioning -a cursor -y在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add rrezartprebreza/spring-boot-skills --skill api-versioning -a claude-code -y在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add rrezartprebreza/spring-boot-skills --skill api-versioning -a codex -y在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add rrezartprebreza/spring-boot-skills --skill api-versioning -a grok -y在 Grok Bot 聊天中傳送複製的訊息。Bot 會從 GitHub 取得這個 SKILL.md,並加入你所有 Bot 共用的技能中。
Install this skill: https://github.com/rrezartprebreza/spring-boot-skills/tree/HEAD/skills/spring-boot-3/api-versioning來自發布者
Boot 3 does not provide Boot 4's built-in mapping version attribute. Choose one explicit
strategy and keep it consistent: URL segments, a request header, or media-type parameters.
For a public API, /api/v1/orders and /api/v2/orders are usually the clearest choice. If URLs
must remain stable, resolve a request header at the web boundary and route to versioned handlers.
Do not hide version selection in business services or duplicate it across filters and controllers.
@RestController
@RequestMapping("/api/v1/orders")
class OrderV1Controller {
@GetMapping("/{id}")
OrderV1 get(@PathVariable UUID id) { ... }
}
Document supported versions in OpenAPI, define a removal policy, and return a consistent error for
unsupported versions. Add Deprecation, Sunset, and Link headers through a response advice or
filter when retiring a version.
Keep version-specific DTOs and controllers thin. Map both versions to the same application use case, and do not copy domain logic into each version. Add contract tests for every supported version and verify content negotiation if using media types.
version attribute on Boot 3 - it is not available; choose an explicit routing strategy.>
---name: api-versioningdescription: >---# skills/spring-boot-3/api-versioning/SKILL.md常見問題
從發布者下載 skills/spring-boot-3/api-versioning/SKILL.md,或複製路徑後開啟儲存庫。PlugMCP 只收錄這項技能,不代管檔案。
發布者將它存放在 https://github.com/rrezartprebreza/spring-boot-skills。
Claude、Cursor、Codex 和 Grok Build 可以讀取你從發布者儲存庫加入的 SKILL.md。在聊天中傳送技能的 GitHub 資料夾連結,Grok Bot 就會安裝它。