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 2d1426348393..be9369a0620a 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 @@ -440,20 +440,20 @@ public class ApiClient { * Content-Type (only JSON is supported for now). */ public Entity serialize(Object obj, Map formParams, String contentType) throws ApiException { - Entity entity = null; + Entity entity = null; if (contentType.startsWith("multipart/form-data")) { - MultipartFormDataOutput multipart = new MultipartFormDataOutput(); + MultipartFormDataOutput multipart = new MultipartFormDataOutput(); //MultiPart multiPart = new MultiPart(); for (Entry param: formParams.entrySet()) { if (param.getValue() instanceof File) { File file = (File) param.getValue(); try { - multipart.addFormData(param.getValue().toString(),new FileInputStream(file),MediaType.APPLICATION_OCTET_STREAM_TYPE); - } catch (FileNotFoundException e) { - throw new ApiException("Could not serialize multipart/form-data "+e.getMessage()); - } + multipart.addFormData(param.getValue().toString(),new FileInputStream(file),MediaType.APPLICATION_OCTET_STREAM_TYPE); + } catch (FileNotFoundException e) { + throw new ApiException("Could not serialize multipart/form-data "+e.getMessage()); + } } else { - multipart.addFormData(param.getValue().toString(),param.getValue().toString(),MediaType.APPLICATION_OCTET_STREAM_TYPE); + multipart.addFormData(param.getValue().toString(),param.getValue().toString(),MediaType.APPLICATION_OCTET_STREAM_TYPE); } } entity = Entity.entity(multipart.getFormData(), MediaType.MULTIPART_FORM_DATA_TYPE); @@ -655,7 +655,7 @@ public class ApiClient { final ClientConfiguration clientConfig = new ClientConfiguration(ResteasyProviderFactory.getInstance()); clientConfig.register(json); if(debugging){ - clientConfig.register(Logger.class); + clientConfig.register(Logger.class); } return ClientBuilder.newClient(clientConfig); } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache index 4147f594daed..07b43e490734 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache @@ -123,18 +123,17 @@ swagger-annotations ${swagger-core-version} - - - org.jboss.resteasy - resteasy-client - ${resteasy-version} - - - org.jboss.resteasy - resteasy-multipart-provider - ${resteasy-version} - + + org.jboss.resteasy + resteasy-client + ${resteasy-version} + + + org.jboss.resteasy + resteasy-multipart-provider + ${resteasy-version} + com.fasterxml.jackson.core diff --git a/samples/client/petstore/java/resteasy/pom.xml b/samples/client/petstore/java/resteasy/pom.xml index 3f0745257487..f3db865f4b27 100644 --- a/samples/client/petstore/java/resteasy/pom.xml +++ b/samples/client/petstore/java/resteasy/pom.xml @@ -117,18 +117,17 @@ swagger-annotations ${swagger-core-version} - - - org.jboss.resteasy - resteasy-client - ${resteasy-version} - - - org.jboss.resteasy - resteasy-multipart-provider - ${resteasy-version} - + + org.jboss.resteasy + resteasy-client + ${resteasy-version} + + + org.jboss.resteasy + resteasy-multipart-provider + ${resteasy-version} + com.fasterxml.jackson.core 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 8390d73d1b37..9d0a6d976ec1 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 @@ -440,20 +440,20 @@ public class ApiClient { * Content-Type (only JSON is supported for now). */ public Entity serialize(Object obj, Map formParams, String contentType) throws ApiException { - Entity entity = null; + Entity entity = null; if (contentType.startsWith("multipart/form-data")) { - MultipartFormDataOutput multipart = new MultipartFormDataOutput(); + MultipartFormDataOutput multipart = new MultipartFormDataOutput(); //MultiPart multiPart = new MultiPart(); for (Entry param: formParams.entrySet()) { if (param.getValue() instanceof File) { File file = (File) param.getValue(); try { - multipart.addFormData(param.getValue().toString(),new FileInputStream(file),MediaType.APPLICATION_OCTET_STREAM_TYPE); - } catch (FileNotFoundException e) { - throw new ApiException("Could not serialize multipart/form-data "+e.getMessage()); - } + multipart.addFormData(param.getValue().toString(),new FileInputStream(file),MediaType.APPLICATION_OCTET_STREAM_TYPE); + } catch (FileNotFoundException e) { + throw new ApiException("Could not serialize multipart/form-data "+e.getMessage()); + } } else { - multipart.addFormData(param.getValue().toString(),param.getValue().toString(),MediaType.APPLICATION_OCTET_STREAM_TYPE); + multipart.addFormData(param.getValue().toString(),param.getValue().toString(),MediaType.APPLICATION_OCTET_STREAM_TYPE); } } entity = Entity.entity(multipart.getFormData(), MediaType.MULTIPART_FORM_DATA_TYPE); @@ -649,7 +649,7 @@ public class ApiClient { final ClientConfiguration clientConfig = new ClientConfiguration(ResteasyProviderFactory.getInstance()); clientConfig.register(json); if(debugging){ - clientConfig.register(Logger.class); + clientConfig.register(Logger.class); } return ClientBuilder.newClient(clientConfig); }