-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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] new library support: Retrofit 2.x #4518
[Kotlin][Client] new library support: Retrofit 2.x #4518
Conversation
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
# Conflicts: # bin/kotlin-client-all.sh # modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java
bin/kotlin-client-all.sh
Outdated
@@ -8,3 +8,4 @@ | |||
./bin/kotlin-client-string.sh | |||
./bin/kotlin-client-threetenbp.sh | |||
./bin/kotlin-client-nullable.sh | |||
./bin/kotlin-client-retrofti2.sh |
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.
typo: kotlin-client-retrofti2.sh => kotlin-client-retrofit2.sh
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.
Thanks for reviewing!
It's solved in this commit: a3b34b5
When using
Can we also auto-generate these files similar to what we've done for other library options in the kotlin generator? |
# Conflicts: # modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache # modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache
Thanks! |
@javils can you please run on the terminal |
bin/kotlin-client-retrofit2.sh
Outdated
|
||
java ${JAVA_OPTS} -jar ${executable} ${ags} | ||
|
||
cp CI/samples.ci/client/petstore/kotlin-threetenbp/pom.xml samples/client/petstore/kotlin-threetenbp/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.
@javils this like is not related to this sample, can you please remove it?
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.
Thanks for reviewing!
Fixed here: 6e4566f
When I run this command I got a lot of modified files and not update the kotlin.md file. Any idea? |
Thanks! |
@wing328 @jimschubert @dr4ke616 @karismann @Zomzog @andrewemery |
I did a test with the auto-generated Kotlin code (retrofit2) for Petstore but got the following errors:
Can you please take a look? |
Thanks for your feedback! |
@javils Since in your last commit you made a change in a |
@4brunu done! |
The build failed 2 times because of this:
|
@javils the shippable failure has been fixed in the master. Can you please merge the latest master into this branch to retrigger the build? |
I still got errors when testing the Petstore samples (kotlin retrofit2):
Does it work for you locally? |
@deprecated has a message param that java not. Add it with a default message.
I have tested this locally and I think now it's working. |
Tested locally and the result is good. Thanks for the PR. |
UPDATE: the library option has been renamed from |
#4517
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.3.x
,5.0.x
. Default:master
.PR Description
This PR add support for retrofit2 as a HTTP library in kotlin-client generator. The reason to add this feature is that I want to port some old android java code to kotlin, but I couldn't because retrofit2 was not supported.
@jimschubert @dr4ke616 @karismann @Zomzog @andrewemery