API versioning in Spring and Spring Boot
API Versioning in Spring
https://spring.io/blog/2025/09/16/api-versioning-in-spring
Embeds the version directly in the URL path. This is considered the most RESTful approach.
spring.mvc.apiversion.use.path-segment=1 (where 1 is the index of the path segment)
Specifies the version using a custom HTTP header.
spring.mvc.apiversion.use.header=X-API-Version
Specifies the version using a query parameter.
spring.mvc.apiversion.use.query-parameter=version
Specifies the version within the Accept header (Content Negotiation).
spring.mvc.apiversion.use.media-type=version