From 44e7b5dd3f6184f07ed47dedc302eb273e73fc1f Mon Sep 17 00:00:00 2001 From: Lars Wander Date: Wed, 26 Jul 2017 09:35:46 -0700 Subject: [PATCH] [Java] Interpret consumes '*/*' as 'application/json' (#6175) --- .../src/main/resources/Java/ApiClient.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache index 4bc3c86d741..01aaef50203 100644 --- a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache @@ -519,10 +519,10 @@ public class ApiClient { * * @param contentTypes The Content-Type array to select from * @return The Content-Type header to use. If the given array is empty, - * JSON will be used. + * or matches "any", JSON will be used. */ public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { + if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { return "application/json"; } for (String contentType : contentTypes) {