enunciate
enunciate copied to clipboard
support for resteasy multipart data types
Hello
I try use @TypeHint to specify the object but doesn't work :(, i thing it's because @Consumes(MediaType.MULTIPART_FORM_DATA)
@Path("register")
@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
@TypeHint(JsonObject.class)
public Response register(@Valid @TypeHint(PlayerRegistrationRequest.class) PlayerRegistrationRequest playerRegistrationRequest) {
try {
repository.register(playerRegistrationRequest.getPlayer(), playerRegistrationRequest.getThumbnail());
return Response.ok().status(Response.Status.OK).entity(Json.createObjectBuilder().add("registration", "success").build()).build();
} catch (RegistrationException e) {
return ResponseTemplate.constructBadRequestResponse(e);
}
}
**The output is **
What tool is converting the multipart/form-data to an instance of PlayerRegistrationRequest
?
Unless I'm mistaken, JAX-RS doesn't have a standard converter for that. So Enunciate doesn't know how to display PlayerRegistrationRequest
as a data type.
What's the @PartType
annotation.
Okay. So this is a request to support resteasy-proprietary multipart (de)serialization.
Okay, you can fix this? :)
Sure, it's possible to do, but it's probably not a high priority at the moment.
ok thanks
This enhancement is currently seeking a sponsor. If anybody is willing to sponsor the work, reach out to me and I'd be happy to pick it up.