From a6cf385739d92d0d0f0865c0b02d80eeb2946caa Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 23 Sep 2024 13:22:23 +0300 Subject: [PATCH] Make media type optional for InputStream when using multipart in REST Client Fixes: #43364 --- .../reactive/deployment/JaxrsClientReactiveProcessor.java | 2 +- .../rest/client/reactive/multipart/MultipartFilenameTest.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/extensions/resteasy-reactive/rest-client-jaxrs/deployment/src/main/java/io/quarkus/jaxrs/client/reactive/deployment/JaxrsClientReactiveProcessor.java b/extensions/resteasy-reactive/rest-client-jaxrs/deployment/src/main/java/io/quarkus/jaxrs/client/reactive/deployment/JaxrsClientReactiveProcessor.java index 24579bdde4a60..8bdb9b9878a33 100644 --- a/extensions/resteasy-reactive/rest-client-jaxrs/deployment/src/main/java/io/quarkus/jaxrs/client/reactive/deployment/JaxrsClientReactiveProcessor.java +++ b/extensions/resteasy-reactive/rest-client-jaxrs/deployment/src/main/java/io/quarkus/jaxrs/client/reactive/deployment/JaxrsClientReactiveProcessor.java @@ -1964,7 +1964,7 @@ private void addInputStream(BytecodeCreator methodCreator, AssignableResultHandl methodCreator.invokeVirtualMethod(MethodDescriptor.ofMethod(ClientMultipartForm.class, "entity", ClientMultipartForm.class, String.class, String.class, Object.class, String.class, Class.class), multipartForm, formParamResult, partFilenameResult, fieldValue, - methodCreator.load(partType), + methodCreator.load(partType != null ? partType : MediaType.APPLICATION_OCTET_STREAM), // FIXME: doesn't support generics methodCreator.loadClassFromTCCL(type))); } diff --git a/extensions/resteasy-reactive/rest-client/deployment/src/test/java/io/quarkus/rest/client/reactive/multipart/MultipartFilenameTest.java b/extensions/resteasy-reactive/rest-client/deployment/src/test/java/io/quarkus/rest/client/reactive/multipart/MultipartFilenameTest.java index 69bec01287d09..f345586162509 100644 --- a/extensions/resteasy-reactive/rest-client/deployment/src/test/java/io/quarkus/rest/client/reactive/multipart/MultipartFilenameTest.java +++ b/extensions/resteasy-reactive/rest-client/deployment/src/test/java/io/quarkus/rest/client/reactive/multipart/MultipartFilenameTest.java @@ -401,7 +401,6 @@ public static class ClientFormUsingByteArray { public static class ClientFormUsingInputStream { @FormParam("myFile") - @PartType(APPLICATION_OCTET_STREAM) @PartFilename(FILE_NAME) public InputStream file; }