sius / swagger-nodegen-cli

A convenience node package to make the swagger-codegen-cli.jar availabe in the node/npm environment
Apache License 2.0
12 stars 5 forks source link

Exit code 0 on error #9

Open m17kea opened 3 years ago

m17kea commented 3 years ago

This command:

swagger-codegen-cli generate -i ${ApiUrl} -l java --artifact-version $SEMANTIC_VERSION --git-repo-id java-client -c config.json

Resulted in an successful 0 exit code:


[main]   INFO io.swagger.parser.Swagger20Parser - reading from   https://***/swagger/v1/swagger.json
--
[main] ERROR   io.swagger.parser.util.RemoteUrl - unable to read
java.io.IOException: Server   returned HTTP response code: 500 for URL: https://***/swagger/v1/swagger.json
at   sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at   sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at   sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at   java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at   sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1950)
at   sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1945)
at   java.security.AccessController.doPrivileged(Native Method)
at   sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1944)
at   sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1514)
at   sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
at   sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
at   io.swagger.parser.util.RemoteUrl.urlToString(RemoteUrl.java:138)
at   io.swagger.parser.Swagger20Parser.read(Swagger20Parser.java:93)
at   io.swagger.parser.SwaggerParser.read(SwaggerParser.java:69)
at   io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:431)
at   io.swagger.codegen.cmd.Generate.run(Generate.java:283)
at   io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Caused   by: java.io.IOException: Server returned HTTP response code: 500 for URL:   https://***/swagger/v1/swagger.json
at   sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)
at   sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
at   sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3061)
at   sun.net.www.protocol.https.HttpsURLConnectionImpl.getHeaderField(HttpsURLConnectionImpl.java:305)
at   io.swagger.parser.util.RemoteUrl.urlToString(RemoteUrl.java:135)
... 5 more

The exit code should have been 1.