OpenAPITools / OpenAPITools/openapi-generator-cli

Make it easy to use with a private maven repository

Offen
#835 0 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@kay-schecker arbeitet bereits daran.

Seit 16.10.2024.

bug
Vorherrschende Sprache
TypeScript
Sterne
2k
Forks
208
Ø Merge
7 Std. 12 Min.
Gemergte PRs (30 T.)
6

Beschreibung

Hello,

I am using the openapi-generator-cli 2.14.0 with a private maven repository (requiring authentication).

Atm using this cli with this setup involves a few steps and makes it feel a bit quirky.

I was wondering if it's possible make the whole process smoother:

  • fix NO_PROXY handling
  • easier authentication to private maven repositories (no credentials hardcoded in the openapitools.json)

Steps to follow to use the openapi-generator-cli with a private maven repository

Here are the steps I needed to follow to make the openapi-generator-cli work in my corporate environment.

Please note: I am used to have HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment vars setup.
The NO_PROXY is set in order to avoid internal http calls to be sent via the proxy.

  1. First run: I get a 503 (returned by my http proxy)
    Ok, this is the issue https://github.com/OpenAPITools/openapi-generator-cli/issues/652
    Fix: I remove all HTTP_PROXY, HTTPS_PROXY

  2. Second run: I get a unable to get local issuer certificate.
    Ok, this is related to https://github.com/OpenAPITools/openapi-generator-cli/issues/130#issuecomment-737277129
    Fix: I add NODE_TLS_REJECT_UNAUTHORIZED=0 as environment variable

  3. Third run: Request failed with status code 401 (returned by my private maven repository)
    Fix: I hardcode my user/pwd credentials in my openapitools.json.
    I am not too happy with this solution since I'll need to do some pre-processing to be able to others dev in my team to use their credentials (or for the ci to run):

    {
      "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
       "spaces": 2,
       "generator-cli": {
         "version": "7.9.0",
         "repository": {
            "downloadUrl": "https://myuser:mypassword@my.corporate.maven.repo.com/repository/mvn-proxy-group/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar"
       }
     }
    }
    

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.