OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
20.84k stars 6.33k forks source link

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

Open mjl269 opened 3 months ago

mjl269 commented 3 months ago
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

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} ?

wing328 commented 3 months ago

we should update these to the latest version: 2.10.1

I wonder if you can contribute a PR for this?