openapi-generator-cli
openapi-generator-cli copied to clipboard
Feature/corporate maven repository
Hello, this PR should make it easier to use the library with a corporate maven repository.
The PR addresses:
- https://github.com/OpenAPITools/openapi-generator-cli/issues/835).
- https://github.com/OpenAPITools/openapi-generator-cli/issues/652
@wing328 or @kay-schecker is it possible for you to review this PR please ?
Contents of this PR:
- fix NO_PROXY issue
This is done by removing explicit handling of HTTP_PROXY and HTTPS_PROXY: Axios already handles that (see https://github.com/axios/axios#request-config). - added
generator-cli.http.rejectUnauthorizedconfiguration to avoid the errorunable to get local issuer certificate. - support using placeholders for environment variables in any configuration value.
this will allow to use env vars to set credentials in the queryUrl or downloadUrl:
Usage:
{ "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", "spaces": 2, "generator-cli": { "version": "7.9.0", "repository": { "downloadUrl": "https://${MVN_USERNAME}:${MVN_PASSWORD}@mynexus.com/repository/maven-proxy-group/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar" } } } - For people using a nexus registry for both npm and maven registry: add support for retrieving authToken in .npmrc and using the npm token to authenticate to the maven repository.
- the credentials for connecting to maven repository (authToken) are retrieved from .npmrc file (the credentials used is the one matching the url of the maven server).
- also, if strict-ssl is set to false in npmrc, then certificate verification is disabled Usage:
{ "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", "spaces": 2, "generator-cli": { "version": "7.9.0", "repository": { "downloadUrl": "https://mynexus.com/repository/maven-proxy-group/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar" }, "useNpmrc": true } } - Fix for running unit tests on windows
- Activates logging (I had some issues testing the library on a project, and the library didn't output any logs)