OpenAPITools / OpenAPITools/openapi-generator

[REQ] [Java][Native] set httpClient to ApiClient class instead of only builder

Open
#21,567 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.