mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 00:43:46 +00:00
[Java] Make Java ApiClient extendable (#21251)
* Make all Java ApiClients in templates extendable * Make all Java ApiClients in samples extendable * Fix compilation of enum constructor * Fix compilation of enum constructor in templates
This commit is contained in:
@@ -54,17 +54,17 @@ import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0-SNAPSHOT")
|
||||
public class ApiClient {
|
||||
|
||||
private HttpClient.Builder builder;
|
||||
private ObjectMapper mapper;
|
||||
private String scheme;
|
||||
private String host;
|
||||
private int port;
|
||||
private String basePath;
|
||||
private Consumer<HttpRequest.Builder> interceptor;
|
||||
private Consumer<HttpResponse<InputStream>> responseInterceptor;
|
||||
private Consumer<HttpResponse<String>> asyncResponseInterceptor;
|
||||
private Duration readTimeout;
|
||||
private Duration connectTimeout;
|
||||
protected HttpClient.Builder builder;
|
||||
protected ObjectMapper mapper;
|
||||
protected String scheme;
|
||||
protected String host;
|
||||
protected int port;
|
||||
protected String basePath;
|
||||
protected Consumer<HttpRequest.Builder> interceptor;
|
||||
protected Consumer<HttpResponse<InputStream>> responseInterceptor;
|
||||
protected Consumer<HttpResponse<String>> asyncResponseInterceptor;
|
||||
protected Duration readTimeout;
|
||||
protected Duration connectTimeout;
|
||||
|
||||
public static String valueToString(Object value) {
|
||||
if (value == null) {
|
||||
@@ -207,7 +207,7 @@ public class ApiClient {
|
||||
return mapper;
|
||||
}
|
||||
|
||||
private String getDefaultBaseUri() {
|
||||
protected String getDefaultBaseUri() {
|
||||
return "http://petstore.swagger.io:80/v2";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user