[REQ] [kotlin-spring] Add clientRegistrationId for spring-declarative-http-interface (parity with Java spring)
Is your feature request related to a problem? Please describe.
When generating a Kotlin HTTP Interface client with kotlin-spring + library=spring-declarative-http-interface (Spring Boot 4 / Security 7), the generated API interfaces do not include @ClientRegistrationId. Without that annotation, Spring Security’s OAuth2 HTTP Service Client integration does not attach tokens for client_credentials (or other registrations).
The Java spring generator already supports this via clientRegistrationId (library=spring-http-interface, useSpringBoot4=true) — see PR #22726 and the spring generator docs. kotlin-spring has no equivalent option, so Kotlin users must post-process generated *Api.kt files.
Describe the solution you'd like
Add a clientRegistrationId config option to kotlin-spring with the same semantics as the Java spring generator:
- When set, and
library=spring-declarative-http-interface(with Boot 4 / Security 7 as required), emit@ClientRegistrationId("<id>")on the generated interface. - Document the option in
kotlin-springdocs.
Example:
generatorName: kotlin-spring
library: spring-declarative-http-interface
additionalProperties:
useSpringBoot4: "true"
interfaceOnly: "true"
clientRegistrationId: assistantExpected:
@ClientRegistrationId("assistant")
interface DocumentsApi {
// ...
}Describe alternatives you've considered
- Gradle
doLastworkaround: inject@ClientRegistrationIdinto generated*Api.ktafter generation (what we do today). - Switch the client generator to Java
spring+spring-http-interface(works, but mixes Java clients into a Kotlin service and splits server/client generators). - Manual/non-generated HTTP interfaces.
Additional context
- Spring Security docs: HTTP Service Clients Integration (
@ClientRegistrationIdon the interface or methods). - Java support: spring generator
clientRegistrationId, PR #22726. - Kotlin declarative HTTP interfaces: PR #22302 /
spring-declarative-http-interface; noclientRegistrationIdin kotlin-spring docs. - openapi-generator version:
7.25.0.
Source: OpenAPITools/openapi-generator