Skip to content

[kotlin-spring] Add clientRegistrationId option for declarative HTTP interface - #25013

Open
kdelay wants to merge 1 commit into
OpenAPITools:masterfrom
kdelay:feat/issue-24936-kotlin-spring-client-registration-id
Open

kdelay wants to merge 1 commit into
OpenAPITools:masterfrom
kdelay:feat/issue-24936-kotlin-spring-client-registration-id

Conversation

@kdelay

@kdelay kdelay commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Adds clientRegistrationId to kotlin-spring for library=spring-declarative-http-interface, same semantics as the Java spring option (#22726).

  • When set, generated interfaces get @ClientRegistrationId("<id>") and its import.
  • spring-boot-starter-oauth2-client is added to the Boot 4 pom/gradle files even if the spec has no security schemes.
  • Requires useSpringBoot4=true; rejected for other libraries.

Unset, output is unchanged: both build-file variants for a spec with and without security schemes generate identical trees before and after, so no samples change.

5 new tests in KotlinSpringServerCodegenTest (279 pass); 4 fail without the fix.

Fixes #24936

cc @karismann @Zomzog @andrewemery @4brunu @yutaka0m @stefankoppier @e5l


Summary by cubic

Adds a clientRegistrationId option to the kotlin-spring generator for the spring-declarative-http-interface library, mirroring the Java spring generator's option (#22726) and fixing #24936.

Behavior

  • When set, generated interfaces get @ClientRegistrationId("<id>") and its import, and spring-boot-starter-oauth2-client is added to Boot 4 build files even without security schemes.
  • Requires useSpringBoot4=true; any other library setting is rejected with an error.
  • Unset, output is unchanged; 5 new tests cover the option.

Written for commit 0f8003f. Summary will update on new commits.

Review in cubic

…interface

Mirror the Java spring generator's clientRegistrationId option (OpenAPITools#22726) for
kotlin-spring with library=spring-declarative-http-interface. When set, the
generated interfaces are annotated with @ClientRegistrationId and the
spring-boot-starter-oauth2-client dependency is added to the Spring Boot 4
build files even if the spec declares no security schemes.

The option requires useSpringBoot4=true and is rejected for other libraries,
matching the Java generator. Output is unchanged when it is not set.

Fixes OpenAPITools#24936

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Re-trigger cubic

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] Add clientRegistrationId for spring-declarative-http-interface (parity with Java spring)

1 participant