-
-
Notifications
You must be signed in to change notification settings - Fork 7k
[kotlin][client] gson complete integration #4332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[kotlin][client] gson complete integration #4332
Conversation
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
I ran
Does it work for you locally? |
Can you please add an entry below https://github.com/OpenAPITools/openapi-generator/blob/master/pom.xml#L1253 to test the kotlin-client-gson samples÷ |
…-client-gson-complete-integration
@wing328 the tests are now passing in the CI server. |
@@ -30,5 +30,3 @@ export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" | |||
ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-okhttp3 --library jvm-okhttp3 -o samples/client/petstore/kotlin-okhttp3 $@" | |||
|
|||
java ${JAVA_OPTS} -jar ${executable} ${ags} | |||
|
|||
#cp CI/samples.ci/client/petstore/kotlin-okhttp3/pom.xml samples/client/petstore/kotlin-okhttp3/pom.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we undo this change?
@@ -30,5 +30,3 @@ export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" | |||
ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-nonpublic --additional-properties nonPublicApi=true -o samples/client/petstore/kotlin-nonpublic $@" | |||
|
|||
java ${JAVA_OPTS} -jar ${executable} ${ags} | |||
|
|||
cp CI/samples.ci/client/petstore/kotlin-string/pom.xml samples/client/petstore/kotlin-string/pom.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we undo this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worry. I'l update those in another PR.
@@ -46,5 +46,5 @@ dependencies { | |||
{{#threetenbp}} | |||
compile "org.threeten:threetenbp:1.4.0" | |||
{{/threetenbp}} | |||
testCompile "io.kotlintest:kotlintest-runner-junit5:3.4.2" | |||
testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@4brunu so downgrading the version actually fixes the issue...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
* master: (28 commits) [meta] Support Kotlin meta generator (OpenAPITools#4156) [Go][Server] minor enhancement to the template (OpenAPITools#4417) Replace the old ResourceSupport (OpenAPITools#4426) [Core, Rust Server, ASP.NET Core] Fix Codegen Operation Scope Consistency (OpenAPITools#3495) Add Go Server featureCORS option (OpenAPITools#4400) Fix treatment of nullable types in a few more places (OpenAPITools#4315) prefix local variable with localVar (OpenAPITools#4402) [kotlin][client] gson complete integration (OpenAPITools#4332) [kotlin] [bugfix] [maven-plugin]: prevent ClassCastException with boolean config options (OpenAPITools#4361) add sbt, bazel to integration (OpenAPITools#4416) Add a blog post tutorial about generating Java clients using OpenAPI v3 (OpenAPITools#4405) add freshcells to company list (OpenAPITools#4414) Update isSet when the object is received from callback. (OpenAPITools#4385) Ruby client nullable (OpenAPITools#4391) Fixes Kotlin client property names that include a dollar sign for template override (OpenAPITools#4351) [Python] [Performance] Avoid unnessacary checks inside the loop (OpenAPITools#4305) Add QEDIT as a company that's using OpenAPI Generator (OpenAPITools#4392) update cpp flag for pistache (OpenAPITools#4386) Feature optional emit default values (OpenAPITools#4347) skip the test as async call may have finished (OpenAPITools#4377) ...
The kotlin client generator, has an option to choose gson as the serialization library, but this only affects the models, the ApiClient still uses Moshi despite choosing gson.
This PR propagates the gson usage to everywhere when it's the choosen serialization library.
It fixes #4331.
PR checklist
./bin/
(or Windows batch scripts under.\bin\windows
) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the code or mustache templates for a language ({LANG}
) (e.g. php, ruby, python, etc).master
,4.1.x
,5.0.x
. Default:master
.@jimschubert (2017/09) ❤️, @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10)