-
Bug
-
Resolution: Not a Bug
-
Major
-
None
-
4.5.5.Final
-
None
While implementing REST-Services in a quarkus application we came across
the problem that when doing fileuploads who are require the use of
resteasy-multipart-provider we can not use custom converters registered
for our POJOs (well in our REST-APIs we only have interfaces).
So what's the problem if we have an REST-Endpoint like this:
@POST @Produces(MediaType.TEXT_PLAIN) @Consumes(MediaType.MULTIPART_FORM_DATA) @Path("multi-interface") public String multiPartInterface(@MultipartForm MPDataInterface data) { return data.metaData.getMetaInfo(); } public static class MPDataInterface { @FormParam("document") @PartType(MediaType.APPLICATION_OCTET_STREAM) public InputStream document; @FormParam("metaData") public IMetaData metaData; }
where IMetaData looks like this:
package at.bestsolution.quarkus;public interface IMetaData { String getMetaInfo(); }
The upload fails because there's not way for REST-Easy to convert from the JSON-Encoded metaData to Java-Object (that's expected).
Because of that we register "ParamConverterProvider" [1] for those
types. This works great for @PathParam(), @QueryParam but fails for the
@MultipartForm.
- is related to
-
RESTEASY-2679 Make JSONB provider to support interface deserialisation
- Closed