-
-
Notifications
You must be signed in to change notification settings - Fork 7k
[Kotlin][Client] Add option to make all api method return a nullable model #4422
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] Add option to make all api method return a nullable model #4422
Conversation
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
a1f5381
to
6b771c4
Compare
617b5a4
to
7920c09
Compare
PR is ready for review. @jimschubert (2017/09) ❤️, @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) |
89bbec8
to
a010d25
Compare
@wing328 Since I dragged in your PR, the circleci step is failing. Do you have an idea for how to fix that? Besides that, the PR is ready for review. I fixed the merge conflicts that were caused by your PR. |
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.
Looks like a great addition! Just had a few questions.
Should we also maybe consider adding a default of false
to the generator, so it's clear in code that this is an option? I eventually want to make additionalProperties sorted by embedded templates to be discoverable.
...enerator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiClient.kt.mustache
Outdated
Show resolved
Hide resolved
samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt
Show resolved
Hide resolved
Thanks for your feedback. 👍
Do you mean adding the option to this readme >> https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/kotlin.md |
@Mordag regarding the default in the generator, I was referring to something like this: Line 394 in 11bcb66
However, based on the other discussions, it looks like there won't be other changes so I can just pick up the additionalProperties thing later. My only remaining question on the PR is related to the mediaType guard. Let me know if you'd like help looking into the CI error. You mentioned it failing after pulling in changes, but I don't see an additional commit (so I didn't know where to begin). It seems from looking at the logs that it failed on Kotlin generation. It could be as simple as missing the executable flag on |
@jimschubert I removed the mediaType for now and updated the samples. If all tests are green, the PR should be ready to 🚢. |
@jimschubert The circleci is going to fail with the same error again. Can you help me try to figure out the root problem? |
9a3d9ef
to
191b411
Compare
I've added new .bat files for the kotlin-client to alllow windows-devs to re-generate required samples via windows-shell (for CI).
In this commit I have also made some changes to the kotlin-client-all.bat to make this file a bit more robust regarding different folder structures.
191b411
to
ad41599
Compare
@Mordag I've opened AlexanderEggers#1 against your branch. This should resolve the CircleCI issue. I didn't merge and fix up in master because your PR is still marked WIP, and GitHub makes it look like you did a force push after you gave thumbs up. If you merge the PR and remove WIP, then I think your changes look good and can be merged once CI is green. Looks like the Shippable failure is just Shippable being flaky on container initialization, it was green on the previous commit, prior to the force push (which removes links to those checks)… see Shippable runs/12015 |
@jimschubert Thanks for helping me resolving the issue with the circleci. 👍
How do I remove the WIP tag? It doesn't seem that I have the needed permissions for that. The force push is only related to a rebase to master. |
No problem! I've gone ahead and removed the WIP. I see now that it was added by auto-labeler and you have since changed the title (hadn't noticed that earlier). |
@Mordag thanks for the PR, which has been included in the v4.2.1 release: https://twitter.com/oas_generator/status/1195339336922759168 |
Closes #4418
data
ofApiInfrastructureResponse.Success
to a nullable typeIt probably makes sense to merge #4419 first. I will take care of any merge conflicts.
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
.