Repository navigation
[kotlin-spring] Add Spring 7 API versioning - #25846
Draft
msamborski-orbis wants to merge 1 commit into
Draft
msamborski-orbis wants to merge 1 commit into
msamborski-orbis wants to merge 1 commit into
Conversation
msamborski-orbis
force-pushed
the
codex/kotlin-spring-api-versioning
branch
from
November 26, 2026 20:45
9009807 to
382ba5e
Compare
msamborski-orbis
force-pushed
the
codex/kotlin-spring-api-versioning
branch
from
November 26, 2026 21:12
382ba5e to
08cb8ad
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add opt-in Spring Framework 7 API versioning to the
kotlin-springspring-bootserver generator, matching the Java Spring feature in #22028.springApiVersionsupplies the default@RequestMapping(version = ...)value. An operation'sx-spring-api-versionoverrides that default; an explicitly empty string omits the version constraint. The operation extension also works without a global default.Both server operation templates support the version attribute, covering normal controllers, interface-only output, and delegate mode, including reactive servers. Version strings use Kotlin string escaping. Client libraries and generation without API-version settings retain their existing output.
The change reuses the existing vendor extension and test fixture, adds the fixture's required OpenAPI responses, and exports the option and extension in the generator documentation. Generated applications require Spring Framework 7+ and must configure their own request version resolver.
Fixes #25845.
Validation
7.29.0-SNAPSHOT.KotlinSpringServerCodegenTest: 348 tests passed, including 14 focused API-version cases covering server modes, reactive output, default/override/empty precedence, Kotlin escaping, client isolation, and older-Spring opt-in behavior.SpringCodegenTest#testApiVersion: passed against the shared fixture.apiVersion.yaml: no validation issues.PR checklist
masterand linked the feature request.