-
Bug
-
Resolution: Done
-
Major
-
2.2.0.ER1, 2.2.5.CR2
-
False
-
False
-
+
-
-
With non-reactive REST Client (quarkus-rest-client), it is possible to do this:
public class Data { public String foo; public Integer bar; }
public class MultipartBody { @FormParam("data") @PartType(MediaType.APPLICATION_JSON) public Data data; }
@Path("/echo") @RegisterRestClient public interface MultipartService { @POST @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.TEXT_PLAIN) String sendMultipartData(@MultipartForm MultipartBody data); }
However, the same does not work with REST Clent Reactive (quarkus-rest-client-reactive).
Invoking the client will result in an error:
... Caused by: org.jboss.resteasy.reactive.client.api.InvalidRestClientDefinitionException: Failed to generate client for class interface org.acme.rest.client.multipart.MultipartService : Unsupported multipart form field on: org.acme.rest.client.multipart.MultipartBody.org.acme.rest.client.multipart.Data. Supported types are: java.lang.String, java.io.File, java.nio.Path and io.vertx.core.Buffer at org.jboss.resteasy.reactive.client.impl.ClientProxies.get(ClientProxies.java:23) at org.jboss.resteasy.reactive.client.impl.WebTargetImpl.proxy(WebTargetImpl.java:382) at io.quarkus.rest.client.reactive.runtime.RestClientBuilderImpl.build(RestClientBuilderImpl.java:273) ... 34 more
Related GitHub issue: https://github.com/quarkusio/quarkus/issues/19892