api-versioning

Installation
SKILL.md

API Versioning (Boot 3 / Framework 6)

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.

Prefer a visible, testable contract

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) { ... }
}
Installs
32
GitHub Stars
271
First Seen
Aug 7, 2026
api-versioning — rrezartprebreza/spring-boot-skills