From 9e5c919560b182a348fc4ffabcda01d7d3f97f26 Mon Sep 17 00:00:00 2001 From: Andrew Hatch Date: Sat, 22 Oct 2022 14:03:57 +0100 Subject: [PATCH] fix parameter ordering for RequestBody.create (#13778) (#13779) --- .../resources/Java/libraries/okhttp-gson/ApiClient.mustache | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index a3423ddea55c..14174bd13a1c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -1085,7 +1085,7 @@ public class ApiClient { } return RequestBody.create(content, MediaType.parse(contentType)); } else if (obj instanceof String) { - return RequestBody.create(MediaType.parse(contentType), (String) obj); + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else { throw new ApiException("Content type \"" + contentType + "\" is not supported"); } diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java index 16b444f047d7..a786c1ea613a 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java @@ -882,7 +882,7 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException } return RequestBody.create(content, MediaType.parse(contentType)); } else if (obj instanceof String) { - return RequestBody.create(MediaType.parse(contentType), (String) obj); + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else { throw new ApiException("Content type \"" + contentType + "\" is not supported"); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java index d8e97ceca561..40ced18009a4 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java @@ -983,7 +983,7 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException } return RequestBody.create(content, MediaType.parse(contentType)); } else if (obj instanceof String) { - return RequestBody.create(MediaType.parse(contentType), (String) obj); + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else { throw new ApiException("Content type \"" + contentType + "\" is not supported"); } diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/ApiClient.java index 0ab49ffc607b..b4a00b46f516 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/ApiClient.java @@ -978,7 +978,7 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException } return RequestBody.create(content, MediaType.parse(contentType)); } else if (obj instanceof String) { - return RequestBody.create(MediaType.parse(contentType), (String) obj); + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else { throw new ApiException("Content type \"" + contentType + "\" is not supported"); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java index c099099fdff0..3a60de4988b0 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java @@ -984,7 +984,7 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException } return RequestBody.create(content, MediaType.parse(contentType)); } else if (obj instanceof String) { - return RequestBody.create(MediaType.parse(contentType), (String) obj); + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else { throw new ApiException("Content type \"" + contentType + "\" is not supported"); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java index 9f2825ce5475..2e8cc2f4e97c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java @@ -1003,7 +1003,7 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException } return RequestBody.create(content, MediaType.parse(contentType)); } else if (obj instanceof String) { - return RequestBody.create(MediaType.parse(contentType), (String) obj); + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else { throw new ApiException("Content type \"" + contentType + "\" is not supported"); }