diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache index 6a26f2d8d8b4..0661db1e0ce8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache @@ -622,7 +622,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @param value The value of the parameter. * @return A list of {@code Pair} objects. */ - public List parameterToPairs(String collectionFormat, String name, Collection value) { + public List parameterToPairs(String collectionFormat, String name, Collection value) { List params = new ArrayList(); // preconditions diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache index a641525af10a..730e975f7390 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache @@ -183,7 +183,7 @@ public class ApiClient { asyncResponseInterceptor = null; } - protected ObjectMapper createDefaultObjectMapper() { + public static ObjectMapper createDefaultObjectMapper() { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); @@ -199,11 +199,11 @@ public class ApiClient { return mapper; } - protected String getDefaultBaseUri() { + private String getDefaultBaseUri() { return "{{{basePath}}}"; } - protected HttpClient.Builder createDefaultHttpClientBuilder() { + public static HttpClient.Builder createDefaultHttpClientBuilder() { return HttpClient.newBuilder(); } diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java index e6411ce783c9..ba3614d09d88 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java @@ -540,7 +540,7 @@ public List parameterToPair(String name, Object value) { * @param value The value of the parameter. * @return A list of {@code Pair} objects. */ - public List parameterToPairs(String collectionFormat, String name, Collection value) { + public List parameterToPairs(String collectionFormat, String name, Collection value) { List params = new ArrayList(); // preconditions diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java index e901d7f6f65b..e9ac66808052 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java @@ -192,7 +192,7 @@ public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri asyncResponseInterceptor = null; } - protected ObjectMapper createDefaultObjectMapper() { + public static ObjectMapper createDefaultObjectMapper() { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); @@ -206,11 +206,11 @@ protected ObjectMapper createDefaultObjectMapper() { return mapper; } - protected String getDefaultBaseUri() { + private String getDefaultBaseUri() { return "http://localhost:3000"; } - protected HttpClient.Builder createDefaultHttpClientBuilder() { + public static HttpClient.Builder createDefaultHttpClientBuilder() { return HttpClient.newBuilder(); } diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java index 496412d49f36..ea63881b3508 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java @@ -633,7 +633,7 @@ public List parameterToPair(String name, Object value) { * @param value The value of the parameter. * @return A list of {@code Pair} objects. */ - public List parameterToPairs(String collectionFormat, String name, Collection value) { + public List parameterToPairs(String collectionFormat, String name, Collection value) { List params = new ArrayList(); // preconditions diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java index db109f5ce505..3b404f212839 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java @@ -192,7 +192,7 @@ public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri asyncResponseInterceptor = null; } - protected ObjectMapper createDefaultObjectMapper() { + public static ObjectMapper createDefaultObjectMapper() { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); @@ -206,11 +206,11 @@ protected ObjectMapper createDefaultObjectMapper() { return mapper; } - protected String getDefaultBaseUri() { + private String getDefaultBaseUri() { return "http://petstore.swagger.io:80/v2"; } - protected HttpClient.Builder createDefaultHttpClientBuilder() { + public static HttpClient.Builder createDefaultHttpClientBuilder() { return HttpClient.newBuilder(); } diff --git a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java index e9ab4dc54511..e5c5cb2f425c 100644 --- a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java @@ -192,7 +192,7 @@ public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri asyncResponseInterceptor = null; } - protected ObjectMapper createDefaultObjectMapper() { + public static ObjectMapper createDefaultObjectMapper() { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); @@ -206,11 +206,11 @@ protected ObjectMapper createDefaultObjectMapper() { return mapper; } - protected String getDefaultBaseUri() { + private String getDefaultBaseUri() { return "http://petstore.swagger.io/v2"; } - protected HttpClient.Builder createDefaultHttpClientBuilder() { + public static HttpClient.Builder createDefaultHttpClientBuilder() { return HttpClient.newBuilder(); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java index db109f5ce505..3b404f212839 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java @@ -192,7 +192,7 @@ public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri asyncResponseInterceptor = null; } - protected ObjectMapper createDefaultObjectMapper() { + public static ObjectMapper createDefaultObjectMapper() { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); @@ -206,11 +206,11 @@ protected ObjectMapper createDefaultObjectMapper() { return mapper; } - protected String getDefaultBaseUri() { + private String getDefaultBaseUri() { return "http://petstore.swagger.io:80/v2"; } - protected HttpClient.Builder createDefaultHttpClientBuilder() { + public static HttpClient.Builder createDefaultHttpClientBuilder() { return HttpClient.newBuilder(); }