Skip to content

[REQ] [Kotlin] client generator support for coroutines and suspend functions #5076

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

Open
NicolaeGP opened this issue Jan 22, 2020 · 3 comments

Comments

@NicolaeGP
Copy link

NicolaeGP commented Jan 22, 2020

Is your feature request related to a problem? Please describe.

I am trying to generate a kotlin client using retrofit 2.6.* and make use of coroutines and suspend functions but that is not given as an option in the generator

Describe the solution you'd like

Addition of a parameter in the generator that will generate a kotlin client with coroutines and suspend functions.

Describe alternatives you've considered

The addition of coroutines and suspend functions would big a big help in creating cleaner code in the applications using the generated client

Additional context

I have seen that there was a request to merge a new kotlin generator
#3135
that contained support for coroutines but instead it was decided to go with the current kotlin generator and add retrofit2 as supported library. However, those changes did not include the possibility of generating suspend functions.

@auto-labeler
Copy link

auto-labeler bot commented Jan 22, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@NicolaeGP NicolaeGP changed the title [REQ] [Kotlin] client generator support for coroutines [REQ] [Kotlin] client generator support for coroutines and suspend functions Jan 22, 2020
@ch4rl3x
Copy link
Contributor

ch4rl3x commented Mar 24, 2020

Hi everyone,

I've been working on adding client generator support in kotlin retrofit 2 for coroutines and suspend functions. I will do a PR.

Thanks guys!

@kuFEAR
Copy link
Contributor

kuFEAR commented Mar 31, 2020

Hi, I've adding rx/rx2/coroutines to in retrofit2, not everybody use coroutines now, I think it will be useful for community. Can you also check my approach?
#5750

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants