swagger-api / swagger-api/swagger-codegen-generators
[Kotlin] option to use suspend / coroutine functions
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 299
- Forks
- 439
- PR merge metrics
- No merged PRs in 30d
Description
I'd like to have the option with the kotlin client for the values to be 'suspend' calls.
My suggestion is to add an option to the configuration for kotlin client generation with 'use coroutines' which will include this library https://github.com/gildor/kotlin-coroutines-okhttp
Then pre-pend suspend to all API calls and add .await() everywhere we use .newCall()
Happy to do work - have a proof of concept already - looking for feedback on if this is a sensible approach and a desirable feature
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No specific files or tests are named. Start by reviewing the Kotlin client generation configuration and the existing API-call templates, then compare them with the reported proof of concept; done means an opt-in coroutine setting adds the dependency and generates suspend calls using await().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100