OpenAPITools / OpenAPITools/openapi-generator

[BUG] bin/utils/openapi-generator-cli.sh fails to detect lastest version

Open
#6,748 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

The script tries to download https://api.github.com/repos/openapitools/openapi-generator/releases and parse the latest version, but the download sometimes can fail and the script results in an error:

jq: error (at <stdin>:1): Cannot index string with string "prerelease"

Yet the script continues the maven build for the jar file and finally fails with error

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.9:get (default-cli) on project standalone-pom: Invalid artifact, you must specify groupId:artifactId:version[:packaging][:classifier] org.openapitools:openapi-generator-cli

The script should not continue to run if the version parsing fails, or it should substitute with a default version.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with bin/utils/openapi-generator-cli.sh and reproduce the failed response from the GitHub releases API, focusing on the jq parsing error. Check the script's behavior before the Maven jar step; done means parsing failure no longer leads to the invalid-artifact Maven error, either by stopping or using a default version.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, shell
Domain
build-system, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.