mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2026-03-09 11:19:05 +00:00
[JAVA][FEIGN] Put back hardcoded HTTP Client but without the performance issue created in 8484. This is fix for 21187 (#22905)
* BUG:21187 put back hardcoded client without the issue created in 8484 * BUG:21187 put back hardcoded client without the issue created in 8484 --------- Co-authored-by: Sri Sushma Karra <srisushmakarra@Sris-MacBook-Air.local>
This commit is contained in:
@@ -25,6 +25,7 @@ import feign.RequestInterceptor;
|
||||
import feign.form.FormEncoder;
|
||||
import feign.gson.GsonDecoder;
|
||||
import feign.gson.GsonEncoder;
|
||||
import feign.okhttp.OkHttpClient;
|
||||
import feign.slf4j.Slf4jLogger;
|
||||
import org.openapitools.client.auth.HttpBasicAuth;
|
||||
import org.openapitools.client.auth.HttpBearerAuth;
|
||||
@@ -40,10 +41,12 @@ public class ApiClient {
|
||||
protected String basePath = "http://localhost:3000";
|
||||
protected Map<String, RequestInterceptor> apiAuthorizations;
|
||||
protected Feign.Builder feignBuilder;
|
||||
private static final OkHttpClient OK_HTTP_CLIENT = new OkHttpClient();
|
||||
|
||||
public ApiClient() {
|
||||
apiAuthorizations = new LinkedHashMap<String, RequestInterceptor>();
|
||||
feignBuilder = Feign.builder()
|
||||
.client(OK_HTTP_CLIENT)
|
||||
.encoder(new FormEncoder(new GsonEncoder()))
|
||||
.decoder(new GsonDecoder())
|
||||
.logger(new Slf4jLogger());
|
||||
|
||||
Reference in New Issue
Block a user