forked from loafle/openapi-generator-original
[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:
@@ -29,6 +29,7 @@ import feign.RequestInterceptor;
|
||||
import feign.form.FormEncoder;
|
||||
import feign.jackson.JacksonDecoder;
|
||||
import feign.jackson.JacksonEncoder;
|
||||
import feign.okhttp.OkHttpClient;
|
||||
import feign.slf4j.Slf4jLogger;
|
||||
import org.openapitools.client.auth.HttpBasicAuth;
|
||||
import org.openapitools.client.auth.HttpBearerAuth;
|
||||
@@ -53,11 +54,13 @@ public class ApiClient {
|
||||
protected String basePath = "http://petstore.swagger.io:80/v2";
|
||||
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>();
|
||||
objectMapper = createObjectMapper();
|
||||
feignBuilder = Feign.builder()
|
||||
.client(OK_HTTP_CLIENT)
|
||||
.encoder(new FormEncoder(new JacksonEncoder(objectMapper)))
|
||||
.decoder(new ApiResponseDecoder(objectMapper))
|
||||
.errorDecoder(new ApiErrorDecoder())
|
||||
|
||||
Reference in New Issue
Block a user