OpenAPITools / OpenAPITools/openapi-generator
[REQ] [Java][Native] set httpClient to ApiClient class instead of only builder
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
I'm using openapi-generator for Java, and i'm using the native library. The problem i have is with instrumentation. I am able to somehow set it up with Micrometer, but everything i try gives me an instance of HttpClient. Unfortunately, i get only to set the builder with setHttpClientBuilder. Is there a way to set HttpClient directly that i'm not aware without possibility of hacky ways to do this?
Describe the solution you'd like
Having something like this
public ApiClient(HttpClient client) {
this.client = client;
}
Describe alternatives you've considered
I'm looking into using a different library, but would be ideal if i can use a native one.
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
Start by locating the Java native ApiClient class and the existing setHttpClientBuilder entry point. Add the requested direct HttpClient construction path and verify that native Java clients can use the supplied client without relying on a builder.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100