OpenAPITools / OpenAPITools/openapi-generator

[BUG][JAVA] Client generation: required gson versions in generated pom.xml (2.10.1) and build.* are different

Open
#18,307 1 comment 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

Description

The required versions of com.google.code.gson:gson differs in a couple of *.mustache files from the version 2.10.1 required in the pom.xml generation templates.

openapi-generator version 7.5.0-SNAPSHOT cloned 2024-04-02

Generation Details

in modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache
implementation 'com.google.code.gson:gson:2.9.1'
in modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache
"com.google.code.gson" % "gson" % "2.8.9",
in modules/openapi-generator/target/classes/Java/libraries/okhttp-gson/build.gradle.mustache
implementation 'com.google.code.gson:gson:2.9.1'
in modules/openapi-generator/target/classes/Java/libraries/okhttp-gson/build.sbt.mustache
"com.google.code.gson" % "gson" % "2.9.1",
in modules/openapi-generator/target/classes/Java/libraries/rest-assured/build.sbt.mustache
"com.google.code.gson" % "gson" % "2.8.9",
in modules/openapi-generator/target/classes/Java/JSON.mustache
* @see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html

Most other generation template files mentioning com.google.code.gson:gson reference ${gson-version}, while some use '2.10.1' as a constant.

Steps to reproduce

Generate for Java client.

Suggest a fix

Use always ${gson-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 by comparing the named Java mustache templates under modules/openapi-generator/src/main/resources/Java/libraries with the pom.xml generation templates, focusing on every com.google.code.gson:gson version. Generate a Java client to inspect the resulting build files. Done means the generated Gson dependency versions consistently follow the project's intended version or shared variable.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.