-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Description
The problem
Right now ApiClient for language java and library okhttp-gson is generated so that it always create a new OkHttpClient, which is not efficient. And it also recommended to have shared instance of OkHttpClient
In my app I'm go to call API, which is the same for different hosts, so I'm enforced to create ApiClient per host. And it creates OkHttpClient per host, which is I want to avoid.
Also it would be great to have possibility to provide own implementation for authentication.
Suggestion
Make it possible to pass OkHttpClient into constructor of ApiClient. Or maybe just not to instantiate it in ApiClient at all and set it via setter. But it's not very clean.
Make it possible to specify own implementation for authorization.
Also
I saw similar issue for WebClient.
#874