Sebastian Beigel
unread,Sep 2, 2021, 12:24:00 PM9/2/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Quarkus Development mailing list
Hi,
I’m testing the REST client reactive using multipart forms but unfortunately it seems to be quite limited as I get the following error using a more advanced data model:
org.jboss.resteasy.reactive.client.api.InvalidRestClientDefinitionException: Failed to generate client for class interface ...: Unsupported multipart form field on: …Data . Supported types are: java.lang.String, java.io.File, java.nio.Path and io.vertx.core.Buffer
I try to use the following endpoint
@Path("/test")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@POST
Response test(@MultipartForm MyForm form);
..with the following “form“:
class MyForm {
@FormParam("data")
@PartType(MediaType.APPLICATION_JSON)
public Data data;
@FormParam("document")
@PartType("application/pdf")
public File document;
}
…while "Data“ is a POJO that should be serialized as JSON:
class Data {
public String foo;
public LocalDate bar;
}
Is it possible to serialize parts with other types than binaries and strings? AFAIR you could use my example perfectly fine in a quarkus REST endpoint (not a REST client) and the multiple parts are deserialized according to their type (and media type).
Thanks,
Sebastian