-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[REQ] Add a Kotlin client Volley library #10011
Comments
@alisters thanks for offering contributions on this. We definitely welcome Volley support via the Let us know if you need any help. |
@wing328 - great. This is progressing, but as always more slowly than hoped ! We are using it in house, and are adding some auth to it. Next update will hopefully be a PR and any/all help and feedback welcomed then. |
|
Design decisions for the Android Kotlin library A kotlin client for Android using the currently recommended http client, Volley. See https://developer.android.com/training/volley
Future improvements
Consumption of the clientHilt Dependency injection example - when constructing our clients, we inject the appropriate header factories. We don't use auth from the api, but in this sample i also inject a basic auth header factory and bind it's credentials
|
I've attempted to add per operation security but can't see an easy way to do it presently.
Have seen that it was done for the python client here - https://github.com/OpenAPITools/openapi-generator/pull/6569/files - but am wondering if this is commonly implemented ? |
@wing328 We've updated the PR after generating the required samples and docs. Could you indicate
I was unable to tag the issue as Kotlin client related when i raised it. I'm happy to be tagged on bugs raised, and to monitor the appropriate tags if you can tell me what they will be. |
@wing328 Some help is required please. I'm unsure why the circle:ci and bitrise builds are failing.
Dry Run Results: k C:\dev...-kotlin-volley.openapi-generator-ignore States:
Circle:ci circle_parallel seems to be failing on the typescript client ?
|
Please ignore those CI failure for the time being. I'll take a look at your PR later today. |
Ok and thank you. If you're not familiar with volley, the major aspect i didn't really call out in the above comments is that volley doesn't directly communicate with an http client - it adds requests to a queue which then interacts with an http client. So in our code gen setup we replaced an apiclient or api invoker that the other kotlin and java clients had with just the RequestFactory. In turn this changes the way you might interact with the code gen in the course of making a given request - how do you set the username and password for a single operation that has overridden global security ? We could put these calls on the request factory but it didn't feel great. TBD further if you wish to. |
Is your feature request related to a problem? Please describe.
We use android and volley, but with Kotlin. Presently there is
Searching the issues shows the volley client may need attention - #9293
Additionally we use co-routines, but my understanding (limited!) of the implementation of co-routines in both these libraries is that whilst they add a suspending function, they then block on it's return. I'd like to see suspendCoroutine, adding the callback listeners to the co-routine continuation, and suspending the co-routine until a value has returned (avoiding tying up a thread until the response arrives). This is the documented way of adapting existing callback based api's to co-routines - though the best explanation of it i've found is in this video, at this point - https://youtu.be/YrrUCSi72E8?t=982
Describe the solution you'd like
I'd like to leverage the model generation in the kotlin client generator, but add a library to for volley
Describe alternatives you've considered
Using one of the existing two generators / libraries. See some of the shortcomings outlined above
Additional context
We've started work on it, and should have a PR ready with basic functionality ready in a week or two. It has some obvious extension points with the ability to pass your own configured requestQueue, or your own factory for mapping from the various http call fields to volley request classes.
The text was updated successfully, but these errors were encountered: