diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache index 43d97e14f196..99ea8a861278 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache @@ -156,9 +156,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { {{/withXml}} Consumer>> messageConverters = converters -> { - converters.add(new MappingJackson2HttpMessageConverter(mapper)); + converters.add(0, new MappingJackson2HttpMessageConverter(mapper)); {{#withXml}} - converters.add(new MappingJackson2XmlHttpMessageConverter(xmlMapper)); + converters.add(0, new MappingJackson2XmlHttpMessageConverter(xmlMapper)); {{/withXml}} }; @@ -750,4 +750,4 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return collectionFormat.collectionToString(values); } -} \ No newline at end of file +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ApiClient.java index becac5699448..e94cb8adb186 100644 --- a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ApiClient.java @@ -141,7 +141,7 @@ protected void init() { */ public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) { Consumer>> messageConverters = converters -> { - converters.add(new MappingJackson2HttpMessageConverter(mapper)); + converters.add(0, new MappingJackson2HttpMessageConverter(mapper)); }; return RestClient.builder().messageConverters(messageConverters); @@ -716,4 +716,4 @@ public String collectionPathParameterToString(CollectionFormat collectionFormat, return collectionFormat.collectionToString(values); } -} \ No newline at end of file +} diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java index f33fddd16707..9496d72835a7 100644 --- a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java @@ -139,7 +139,7 @@ protected void init() { */ public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) { Consumer>> messageConverters = converters -> { - converters.add(new MappingJackson2HttpMessageConverter(mapper)); + converters.add(0, new MappingJackson2HttpMessageConverter(mapper)); }; return RestClient.builder().messageConverters(messageConverters); @@ -714,4 +714,4 @@ public String collectionPathParameterToString(CollectionFormat collectionFormat, return collectionFormat.collectionToString(values); } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java index b54e44bc8bc8..1e61575bf5c1 100644 --- a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java @@ -139,7 +139,7 @@ protected void init() { */ public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) { Consumer>> messageConverters = converters -> { - converters.add(new MappingJackson2HttpMessageConverter(mapper)); + converters.add(0, new MappingJackson2HttpMessageConverter(mapper)); }; return RestClient.builder().messageConverters(messageConverters); @@ -714,4 +714,4 @@ public String collectionPathParameterToString(CollectionFormat collectionFormat, return collectionFormat.collectionToString(values); } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java index f81804f49586..b6167e60aff5 100644 --- a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java @@ -145,7 +145,7 @@ protected void init() { */ public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) { Consumer>> messageConverters = converters -> { - converters.add(new MappingJackson2HttpMessageConverter(mapper)); + converters.add(0, new MappingJackson2HttpMessageConverter(mapper)); }; return RestClient.builder().messageConverters(messageConverters); @@ -734,4 +734,4 @@ public String collectionPathParameterToString(CollectionFormat collectionFormat, return collectionFormat.collectionToString(values); } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/restclient-useSingleRequestParameter/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/restclient-useSingleRequestParameter/src/main/java/org/openapitools/client/ApiClient.java index f81804f49586..b6167e60aff5 100644 --- a/samples/client/petstore/java/restclient-useSingleRequestParameter/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/restclient-useSingleRequestParameter/src/main/java/org/openapitools/client/ApiClient.java @@ -145,7 +145,7 @@ protected void init() { */ public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) { Consumer>> messageConverters = converters -> { - converters.add(new MappingJackson2HttpMessageConverter(mapper)); + converters.add(0, new MappingJackson2HttpMessageConverter(mapper)); }; return RestClient.builder().messageConverters(messageConverters); @@ -734,4 +734,4 @@ public String collectionPathParameterToString(CollectionFormat collectionFormat, return collectionFormat.collectionToString(values); } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ApiClient.java index f81804f49586..b6167e60aff5 100644 --- a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ApiClient.java @@ -145,7 +145,7 @@ protected void init() { */ public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) { Consumer>> messageConverters = converters -> { - converters.add(new MappingJackson2HttpMessageConverter(mapper)); + converters.add(0, new MappingJackson2HttpMessageConverter(mapper)); }; return RestClient.builder().messageConverters(messageConverters); @@ -734,4 +734,4 @@ public String collectionPathParameterToString(CollectionFormat collectionFormat, return collectionFormat.collectionToString(values); } -} \ No newline at end of file +}