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
I am encountering an issue with the openapi-generator-maven-plugin (version 6.2.1) while attempting to generate API stubs from a remote OpenAPI specification file hosted on SwaggerHub. The build process consistently fails due to what appears to be incorrect handling of proxy credentials.
Our build environment is behind a corporate proxy that requires basic authentication. The proxy is configured correctly, and the SwaggerHub URL is whitelisted and accessible from within the build pipeline. However, the openapi-generator-maven-plugin, which relies on the Swagger parser for handling the OpenAPI spec, seems unable to pass the provided proxy credentials when attempting to access external URLs. This results in the failure to download the OpenAPI specification.
From my observations, it seems the Swagger parser is not handling the proxy credentials as expected. Could this be an issue with the way the Swagger parser manages proxy authentication?
Is there a known workaround, or is there any additional configuration that might ensure proper handling of proxy credentials in this scenario?
None of these approaches resolved the issue. I also tried setting the flags within MAVEN_OPTS, JAVA_OPT, and JAVA_TOOL_OPTIONS, with no success.
Error Output
The relevant part of the error message:
[ERROR] unable to read
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
at sun.net.www.protocol.http.HttpURLConnection.doTunneling0 (HttpURLConnection.java:2296)
at sun.net.www.protocol.http.HttpURLConnection.doTunneling (HttpURLConnection.java:2166)
at io.swagger.v3.parser.util.RemoteUrl.urlToString (RemoteUrl.java:151)
For full error log see attached error logs. error-log.txt
The text was updated successfully, but these errors were encountered:
Description
I am encountering an issue with the openapi-generator-maven-plugin (version 6.2.1) while attempting to generate API stubs from a remote OpenAPI specification file hosted on SwaggerHub. The build process consistently fails due to what appears to be incorrect handling of proxy credentials.
Our build environment is behind a corporate proxy that requires basic authentication. The proxy is configured correctly, and the SwaggerHub URL is whitelisted and accessible from within the build pipeline. However, the openapi-generator-maven-plugin, which relies on the Swagger parser for handling the OpenAPI spec, seems unable to pass the provided proxy credentials when attempting to access external URLs. This results in the failure to download the OpenAPI specification.
From my observations, it seems the Swagger parser is not handling the proxy credentials as expected. Could this be an issue with the way the Swagger parser manages proxy authentication?
Is there a known workaround, or is there any additional configuration that might ensure proper handling of proxy credentials in this scenario?
Environment
openapi-generator-maven-plugin: 6.2.1
Maven: 3.x
JDK: OpenJDK 17
Build Environment: Docker (Alpine-based container in AWS CodePipeline)
What I've Tried
Configuring proxy credentials in settings.xml:
Enabling basic authentication with the following flags:
Setting the proxy values within the Maven command:
None of these approaches resolved the issue. I also tried setting the flags within MAVEN_OPTS, JAVA_OPT, and JAVA_TOOL_OPTIONS, with no success.
Error Output
The relevant part of the error message:
For full error log see attached error logs.
error-log.txt
The text was updated successfully, but these errors were encountered: