You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When generating models, http clients interfaces and implementations with library: spring-http-interface, I've noticed 2 limitations:
the generated HttpInterfacesAbstractConfigurator only works with spring reactive WebClient implementation, which might not be flexible enough for users who want to generate non-reactive Spring Boot applications.
the generated models seem to inherit the Parameter annotation from JavaSpring/paramDoc.mustache which leads to compile errors, since the io.swagger.v3.oas.annotations.Parameter is not imported in the generated API clients
Describe the solution you'd like
Introduce the springHttpClientAdapter additional option for the spring-http-interface library
This property is used for selecting HTTP client implementation in Spring HTTP interfaces, with separate templates for each client configuration
Added an spring-http-interface-specific emptyparamDoc.mustache so that the generated client classes methods are no longer annotated with theio.swagger.v3.oas.annotations.Parameter
Describe alternatives you've considered
Tried generating with documentationProvider : 'none' additional property, but that seems to be the default anyway when using library: spring-http-interface and still getting that Parameter annotation on request body methods' parameters
Another possible approach to address the flexibility-factor with regards to specific Spring client implementation would be to inject a HttpServiceProxyFactory instance in the generated HttpInterfacesAbstractConfigurator, rather than a WebClient, RestClient, or RestTemplate, as specified by the proposed springHttpClientAdapter additional property.
E.g. the generated HttpInterfacesAbstractConfigurator would look like this:
public abstract class HttpInterfacesAbstractConfigurator {
private final HttpServiceProxyFactory httpServiceProxyFactory;
public HttpInterfacesAbstractConfigurator(final HttpServiceProxyFactory httpServiceProxyFactory) {
this.httpServiceProxyFactory = httpServiceProxyFactory;
}
@Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.sample")
SampleApi sampleHttpProxy() {
return httpServiceProxyFactory.createClient(SampleApi.class);
}
}
ibaranga
changed the title
[REQ] spring-http-interface: support multiple Spring http client implementations
[REQ] spring-http-interface: fix unnecessary Parameter request body annotation, support multiple Spring http client implementations
Sep 29, 2024
ibaranga
changed the title
[REQ] spring-http-interface: fix unnecessary Parameter request body annotation, support multiple Spring http client implementations
[REQ] spring-http-interface: support multiple Spring http client implementations, fix unnecessary Parameter request body annotation
Sep 29, 2024
Is your feature request related to a problem? Please describe.
When generating models, http clients interfaces and implementations with
library: spring-http-interface
, I've noticed 2 limitations:HttpInterfacesAbstractConfigurator
only works with spring reactiveWebClient
implementation, which might not be flexible enough for users who want to generate non-reactive Spring Boot applications.Parameter
annotation fromJavaSpring/paramDoc.mustache
which leads to compile errors, since theio.swagger.v3.oas.annotations.Parameter
is not imported in the generated API clientsDescribe the solution you'd like
springHttpClientAdapter
additional option for thespring-http-interface
libraryspring-http-interface
-specific emptyparamDoc.mustache
so that the generated client classes methods are no longer annotated with theio.swagger.v3.oas.annotations.Parameter
Describe alternatives you've considered
Tried generating with
documentationProvider : 'none'
additional property, but that seems to be the default anyway when usinglibrary: spring-http-interface
and still getting thatParameter
annotation on request body methods' parametersAnother possible approach to address the flexibility-factor with regards to specific Spring client implementation would be to inject a
HttpServiceProxyFactory
instance in the generatedHttpInterfacesAbstractConfigurator
, rather than aWebClient
,RestClient
, orRestTemplate
, as specified by the proposedspringHttpClientAdapter
additional property.E.g. the generated
HttpInterfacesAbstractConfigurator
would look like this:Additional context
Solution proposal: #19710
The text was updated successfully, but these errors were encountered: