Skip to content

[kotlin-spring] Add Spring 7 API versioning - #25846

Draft
msamborski-orbis wants to merge 1 commit into
OpenAPITools:masterfrom
msamborski-orbis:codex/kotlin-spring-api-versioning
Draft

msamborski-orbis wants to merge 1 commit into
OpenAPITools:masterfrom
msamborski-orbis:codex/kotlin-spring-api-versioning

Conversation

@msamborski-orbis

@msamborski-orbis msamborski-orbis commented Nov 26, 2026 •

Copy link
Copy Markdown

Add opt-in Spring Framework 7 API versioning to the kotlin-spring spring-boot server generator, matching the Java Spring feature in #22028.

springApiVersion supplies the default @RequestMapping(version = ...) value. An operation's x-spring-api-version overrides 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

  • Maven package for the CLI and its dependencies passed on 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.
  • CLI validation of apiVersion.yaml: no validation issues.
  • Regenerated all 37 existing Kotlin Spring sample configurations: no output changes.
  • Regenerated Kotlin Spring documentation: output matches the committed documentation.

PR checklist

  • Read the contribution guidelines.
  • Built the affected modules, regenerated existing samples, and exported the generator documentation.
  • Targeted master and linked the feature request.
  • Mentioned the relevant technical committee member: @Zomzog.

@msamborski-orbis
msamborski-orbis force-pushed the codex/kotlin-spring-api-versioning branch from 9009807 to 382ba5e Compare November 26, 2026 20:45
@msamborski-orbis
msamborski-orbis force-pushed the codex/kotlin-spring-api-versioning branch from 382ba5e to 08cb8ad Compare November 26, 2026 21:12

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REQ][kotlin-spring] Support Spring 7 API versioning

1 participant