Open gerardbosch opened 5 years ago
I could not solve the issue, BUT.. I took another aproach and instead of referencing the remote API-components from Bitbucket, I managed to publish my API definitions to the corporate Artifactory, which gave me a different URL to reference from the Bitbucket's one. Doing that way, the generator has been able to read remote definition references and therefore build successfully.
So I started to think more about the possibility that the "bug" is in the way the generator handles this kind of URLs:
http://myorganization.com/bitbucket/projects/FOO/repos/api-foo/raw/api-foo.yaml?at=refs%2Ftags%2Fv1.0
My problem is solved so far, but I think the issue still makes sense.
P.S. The URL above can be accessed correctly with curl or browser.
Same issue here. The plugin doesn't respect maven proxy settings when resolving URLs, which I guess is a twofold problem - this component has no proxy settings configuration, and the plugin does not pass that config to the parser. I was able to workaround the issue by explicitly passing the proxy parameters to the maven command line:
mvn clean package -DskipTests -Dhttp.proxyHost=10.184.xxx.xxx -Dhttp.proxyPort=8080 -Dhttps.proxyHost=10.184.xxx.xxx -Dhttps.proxyPort=8080
The URLConnection class automatically picks up those parameters.
I have my API definition in a YAML file and I tried to use absolute references to make references to common or shared API "components" (or fragments) hosted on a dedicated repository and publicly accessible via http in order to reuse those components in several API definitions.
But it looks that the generator (openapi-generator-maven-plugin) fails to reach these remote API definitions when I run it in a corporate network. I've tried the same outside the work network and it works fine. So that's why I think it could be a problem with the proxy. I must point that other maven plugins such as WGET:
do work with the same network and setup, that's what I think it is not a Maven or network issue.
The result is that it can't reach the referenced components via http and generation fails.
I'm using the Maven
openapi-generator-maven-plugin:3.3.4
to generate my API artifacts from YAML definitions.The maven is run by corporate Jenkins CI (but I insist that maven wget plugin works fine in the same setup)
The remote component URL is something like this: http://myprivateorganization.foo/bitbucket/projects/FOO/repos/api-foo/raw/api-foo.yaml?at=refs%2Ftags%2Fv1.0 (which is a versioned tag of the API), so I reference it inside API definition (yaml) like the following:
I provide the stack-trace of the generation in case can help: