diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index 0d707c5b39..26eb2c8a33 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -438,12 +438,13 @@ public class ApiClient { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json + * "* / *" is also default to JSON * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json")); + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); } /** diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 24d0c89d10..94f89a56dd 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -571,12 +571,13 @@ public class ApiClient { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json + * "* / *" is also default to JSON * @param mime MIME (Multipurpose Internet Mail Extensions) * @return True if the given MIME is JSON, false otherwise. */ public boolean isJsonMime(String mime) { String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json")); + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); } /** diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/ApiClient.mustache index 9ca31c6073..b41f31903b 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/ApiClient.mustache @@ -377,9 +377,13 @@ public class ApiClient { * application/json * application/json; charset=UTF8 * APPLICATION/JSON + * application/vnd.company+json + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. */ public boolean isJsonMime(String mime) { - return mime != null && mime.matches("(?i)application\\/json(;.*)?"); + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); } /** diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index 0177d25b78..567fc6d25d 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -424,6 +424,11 @@ public class ApiClient { * @return boolean true if the MediaType represents JSON, false otherwise */ public boolean isJsonMime(String mediaType) { + // "* / *" is default to JSON + if ("*/*".equals(mediaType)) { + return true; + } + try { return isJsonMime(MediaType.parseMediaType(mediaType)); } catch (InvalidMediaTypeException e) { diff --git a/samples/client/petstore/java/feign/gradlew b/samples/client/petstore/java/feign/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java index 6113e3deb2..6713ec2c10 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java @@ -39,7 +39,7 @@ public class Cat extends Animal { * @return declawed **/ @ApiModelProperty(value = "") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java index 2edfd83b31..adcd2b0d82 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java @@ -181,7 +181,7 @@ public class Order { * @return complete **/ @ApiModelProperty(value = "") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/client/petstore/java/jersey1/gradlew b/samples/client/petstore/java/jersey1/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java index 7a3082bef6..c62ed807dc 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java @@ -512,10 +512,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) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java index 6113e3deb2..6713ec2c10 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java @@ -39,7 +39,7 @@ public class Cat extends Animal { * @return declawed **/ @ApiModelProperty(value = "") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java index 2edfd83b31..adcd2b0d82 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java @@ -181,7 +181,7 @@ public class Order { * @return complete **/ @ApiModelProperty(value = "") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/client/petstore/java/jersey2-java6/gradlew b/samples/client/petstore/java/jersey2-java6/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiClient.java index 42f3a9c702..b3cd7018ac 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiClient.java @@ -432,12 +432,13 @@ public class ApiClient { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json + * "* / *" is also default to JSON * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json")); + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); } /** diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Cat.java index ea4a0e3e8d..fe1f0ce994 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Cat.java @@ -39,7 +39,7 @@ public class Cat extends Animal { * @return declawed **/ @ApiModelProperty(value = "") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Order.java index 32de914a76..7db40bf275 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Order.java @@ -181,7 +181,7 @@ public class Order { * @return complete **/ @ApiModelProperty(value = "") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/client/petstore/java/jersey2-java8/gradlew b/samples/client/petstore/java/jersey2-java8/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java index 3a898f314a..c9b0a51e0d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java @@ -13,8 +13,8 @@ import javax.ws.rs.core.Response.Status; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.ClientProperties; -import org.glassfish.jersey.filter.LoggingFilter; import org.glassfish.jersey.jackson.JacksonFeature; +import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.media.multipart.FormDataBodyPart; import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import org.glassfish.jersey.media.multipart.MultiPart; @@ -51,21 +51,21 @@ import io.swagger.client.auth.OAuth; public class ApiClient { - private Map defaultHeaderMap = new HashMap(); - private String basePath = "http://petstore.swagger.io:80/v2"; - private boolean debugging = false; - private int connectionTimeout = 0; + protected Map defaultHeaderMap = new HashMap(); + protected String basePath = "http://petstore.swagger.io:80/v2"; + protected boolean debugging = false; + protected int connectionTimeout = 0; - private Client httpClient; - private JSON json; - private String tempFolderPath = null; + protected Client httpClient; + protected JSON json; + protected String tempFolderPath = null; - private Map authentications; + protected Map authentications; - private int statusCode; - private Map> responseHeaders; + protected int statusCode; + protected Map> responseHeaders; - private DateFormat dateFormat; + protected DateFormat dateFormat; public ApiClient() { json = new JSON(); @@ -433,12 +433,13 @@ public class ApiClient { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json + * "* / *" is also default to JSON * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json")); + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); } /** @@ -729,18 +730,26 @@ public class ApiClient { * @param debugging Debug setting * @return Client */ - private Client buildHttpClient(boolean debugging) { + protected Client buildHttpClient(boolean debugging) { final ClientConfig clientConfig = new ClientConfig(); clientConfig.register(MultiPartFeature.class); clientConfig.register(json); clientConfig.register(JacksonFeature.class); if (debugging) { - clientConfig.register(new LoggingFilter(java.util.logging.Logger.getLogger(LoggingFilter.class.getName()), true)); + clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); + clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); + // Set logger to ALL + java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); } + performAdditionalClientConfiguration(clientConfig); return ClientBuilder.newClient(clientConfig); } - private Map> buildResponseHeaders(Response response) { + protected void performAdditionalClientConfiguration(ClientConfig clientConfig) { + // No-op extension point + } + + protected Map> buildResponseHeaders(Response response) { Map> responseHeaders = new HashMap>(); for (Entry> entry: response.getHeaders().entrySet()) { List values = entry.getValue(); @@ -758,7 +767,7 @@ public class ApiClient { * * @param authNames The authentications to apply */ - private void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams) { + protected void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams) { for (String authName : authNames) { Authentication auth = authentications.get(authName); if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/PetApi.java index c8f8b730ca..abac5af4ad 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/PetApi.java @@ -168,6 +168,7 @@ public class PetApi { * @param tags Tags to filter by (required) * @return List<Pet> * @throws ApiException if fails to make API call + * @Deprecated */ public List findPetsByTags(List tags) throws ApiException { Object localVarPostBody = null; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java index 6113e3deb2..6713ec2c10 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java @@ -39,7 +39,7 @@ public class Cat extends Animal { * @return declawed **/ @ApiModelProperty(value = "") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java index 93586da486..2df787c40a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java @@ -181,7 +181,7 @@ public class Order { * @return complete **/ @ApiModelProperty(value = "") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/client/petstore/java/jersey2/gradlew b/samples/client/petstore/java/jersey2/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/ApiClient.java index 63d5f5c226..c9b0a51e0d 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/ApiClient.java @@ -433,12 +433,13 @@ public class ApiClient { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json + * "* / *" is also default to JSON * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json")); + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); } /** diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java index 6113e3deb2..6713ec2c10 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java @@ -39,7 +39,7 @@ public class Cat extends Animal { * @return declawed **/ @ApiModelProperty(value = "") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java index 2edfd83b31..adcd2b0d82 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java @@ -181,7 +181,7 @@ public class Order { * @return complete **/ @ApiModelProperty(value = "") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/gradlew b/samples/client/petstore/java/okhttp-gson-parcelableModel/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java index 0a2fa40147..90bc07435c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java @@ -552,12 +552,13 @@ public class ApiClient { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json + * "* / *" is also default to JSON * @param mime MIME (Multipurpose Internet Mail Extensions) * @return True if the given MIME is JSON, false otherwise. */ public boolean isJsonMime(String mime) { String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json")); + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); } /** diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java index f2c67bca7c..8b05666d75 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java @@ -44,7 +44,7 @@ public class Cat extends Animal implements Parcelable { * @return declawed **/ @ApiModelProperty(value = "") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java index b53b9e204a..530643ab4e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java @@ -198,7 +198,7 @@ public class Order implements Parcelable { * @return complete **/ @ApiModelProperty(value = "") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/client/petstore/java/okhttp-gson/gradlew b/samples/client/petstore/java/okhttp-gson/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java index 0a2fa40147..90bc07435c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java @@ -552,12 +552,13 @@ public class ApiClient { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json + * "* / *" is also default to JSON * @param mime MIME (Multipurpose Internet Mail Extensions) * @return True if the given MIME is JSON, false otherwise. */ public boolean isJsonMime(String mime) { String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json")); + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); } /** diff --git a/samples/client/petstore/java/resteasy/gradlew b/samples/client/petstore/java/resteasy/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java index 84212e9462..88478cfaa8 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java @@ -377,9 +377,13 @@ public class ApiClient { * application/json * application/json; charset=UTF8 * APPLICATION/JSON + * application/vnd.company+json + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. */ public boolean isJsonMime(String mime) { - return mime != null && mime.matches("(?i)application\\/json(;.*)?"); + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); } /** diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Cat.java index 6113e3deb2..6713ec2c10 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Cat.java @@ -39,7 +39,7 @@ public class Cat extends Animal { * @return declawed **/ @ApiModelProperty(value = "") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java index 2edfd83b31..adcd2b0d82 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java @@ -181,7 +181,7 @@ public class Order { * @return complete **/ @ApiModelProperty(value = "") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/client/petstore/java/resttemplate-withXml/.swagger-codegen/VERSION b/samples/client/petstore/java/resttemplate-withXml/.swagger-codegen/VERSION index 7fea99011a..f9f7450d13 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/resttemplate-withXml/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/gradlew b/samples/client/petstore/java/resttemplate/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/ApiClient.java index d8d84aedfb..dec5e46697 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/ApiClient.java @@ -411,6 +411,11 @@ public class ApiClient { * @return boolean true if the MediaType represents JSON, false otherwise */ public boolean isJsonMime(String mediaType) { + // "* / *" is default to JSON + if ("*/*".equals(mediaType)) { + return true; + } + try { return isJsonMime(MediaType.parseMediaType(mediaType)); } catch (InvalidMediaTypeException e) { @@ -645,4 +650,4 @@ public class ApiClient { return builder.toString(); } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Cat.java index 6113e3deb2..6713ec2c10 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Cat.java @@ -39,7 +39,7 @@ public class Cat extends Animal { * @return declawed **/ @ApiModelProperty(value = "") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java index 2edfd83b31..adcd2b0d82 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java @@ -181,7 +181,7 @@ public class Order { * @return complete **/ @ApiModelProperty(value = "") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/client/petstore/java/retrofit/gradlew b/samples/client/petstore/java/retrofit/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java index 87b2c00ea1..c792aabac2 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java @@ -42,7 +42,7 @@ public class Cat extends Animal { * @return declawed **/ @ApiModelProperty(value = "") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java index 3249680760..b37783e576 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java @@ -196,7 +196,7 @@ public class Order { * @return complete **/ @ApiModelProperty(value = "") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/client/petstore/java/retrofit2-play24/gradlew b/samples/client/petstore/java/retrofit2-play24/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java index d2d8ad0752..0694cba6dc 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java @@ -41,7 +41,7 @@ public class Cat extends Animal { * @return declawed **/ @ApiModelProperty(value = "") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java index 275172b86f..164cd40870 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java @@ -184,7 +184,7 @@ public class Order { * @return complete **/ @ApiModelProperty(value = "") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/client/petstore/java/retrofit2/gradlew b/samples/client/petstore/java/retrofit2/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java index 87b2c00ea1..c792aabac2 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java @@ -42,7 +42,7 @@ public class Cat extends Animal { * @return declawed **/ @ApiModelProperty(value = "") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java index 7856f4baf7..cab388bc2a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java @@ -196,7 +196,7 @@ public class Order { * @return complete **/ @ApiModelProperty(value = "") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/client/petstore/java/retrofit2rx/gradlew b/samples/client/petstore/java/retrofit2rx/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java index 87b2c00ea1..c792aabac2 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java @@ -42,7 +42,7 @@ public class Cat extends Animal { * @return declawed **/ @ApiModelProperty(value = "") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java index 7856f4baf7..cab388bc2a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java @@ -196,7 +196,7 @@ public class Order { * @return complete **/ @ApiModelProperty(value = "") - public Boolean getComplete() { + public Boolean isComplete() { return complete; } diff --git a/samples/client/petstore/java/retrofit2rx2/gradlew b/samples/client/petstore/java/retrofit2rx2/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Cat.java index 87b2c00ea1..c792aabac2 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Cat.java @@ -42,7 +42,7 @@ public class Cat extends Animal { * @return declawed **/ @ApiModelProperty(value = "") - public Boolean getDeclawed() { + public Boolean isDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Order.java index 7856f4baf7..cab388bc2a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Order.java @@ -196,7 +196,7 @@ public class Order { * @return complete **/ @ApiModelProperty(value = "") - public Boolean getComplete() { + public Boolean isComplete() { return complete; }