[kotlin] Allow clients to specify OkHttpClient instance for configura…
…tion use cases.
PR checklist
- [X] Read the contribution guidelines.
- [X] Ran the shell script under
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\. - [X] Filed the PR against the correct branch:
3.0.0branch for changes related to OpenAPI spec 3.0. Default:master. - [X] Copied the technical committee to review the pull request if your PR is targeting a particular programming language.
Description of the PR
This change causes the internal static OkHttpClient in ApiClient to be passed in the constructor rather than using a private static instance. This is desired so that HTTP debug logging can be configured. The constructor change propagates to DefaultApi class. A default value is constructed which can alternatively be supplied by the client.
This was the simplest way that occurred to me to allow this access but there may be other approaches that are better.
I had a git configuration issue with my work computer, this is a fixed PR. The original: https://github.com/swagger-api/swagger-codegen/pull/7623. The only difference is my email address associated with the commit.
Testing:
- I've consumed my forked repo branch via jitpack on an internal project and have used the feature successfully.
- Unit tests pass.
CC @jimschubert
Just following up on this PR... Are there any concerns with this change?
I don't see any issues (looks the same as the previous closed PR).
This is a good idea. We also need access to this to control request connection timeout