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
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
The generated client code for java (using jersey) has a bug. You cannot enable debug for the client requests. When setting debug to true setDebugging(true) the setter has a side-effect of also recreating the httpClient by calling buildHttpClient(). The call to buildHttpClient() is desirable but the method contains an if block which prevents the call to getDefaultClientConfig() if it is already set favouring the existing config.
// use the default client config if not yet initializedif (clientConfig == null) {
clientConfig = getDefaultClientConfig();
}
Unfortunately this skips enabling the debug settings which is set within the getDefaultClientConfig() method.
I will prepare a PR which removes this check resulting in the creation of a new clientConfig on each call to buildHttpClient() which I believe is the intended outcome.
Bug Report Checklist
Description
The generated client code for java (using jersey) has a bug. You cannot enable debug for the client requests. When setting debug to true
setDebugging(true)
the setter has a side-effect of also recreating the httpClient by callingbuildHttpClient()
. The call tobuildHttpClient()
is desirable but the method contains an if block which prevents the call togetDefaultClientConfig()
if it is already set favouring the existing config.Unfortunately this skips enabling the debug settings which is set within the
getDefaultClientConfig()
method.I will prepare a PR which removes this check resulting in the creation of a new
clientConfig
on each call tobuildHttpClient()
which I believe is the intended outcome.openapi-generator version
openapi-generator v5.0.0+
OpenAPI declaration file content or url
https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml
Generation Details
-g java
--additional-properties=library=jersey2
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java --additional-properties=library=jersey2 -i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o ~/tmp/java-client-test
Steps to reproduce
run the command above
Related issues/PRs
Suggest a fix
I'm preparing a PR which will remove the check
The text was updated successfully, but these errors were encountered: