quarkus: RESTEasy Reactive - mapping MULTIPART_FORM_DATA to request body don't work
Describe the bug
with https://github.com/quarkusio/quarkus/pull/27526 in place, my multiplart form data request body is always null. My endpoint looks like:
// resource method
@POST
@Path("/echo")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.TEXT_PLAIN)
public String echo(String requestBody) {
return requestBody;
}
same situation is for wrapper
// resource method
@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.TEXT_PLAIN)
@Path("/upload-multipart")
@Blocking
public String uploadMultipart(FileWrapper body) {
deathRow.add(body.file);
return utils.getSum(body.file.getAbsoluteFile().toPath());
}
...
@RegisterForReflection
public class FileWrapper {
@RestForm("file")
@PartType(MediaType.APPLICATION_OCTET_STREAM)
public File file;
@RestForm("name")
@PartType(MediaType.TEXT_PLAIN)
public String name;
}
Expected behavior
- Provide a way how I can map the request to the String (ideally OOTB).
- Make docs dummy proof (customize docs for me).
Actual behavior
requestBody is always null. body is not null but its fields are null.
How to Reproduce?
Reproducer:
Steps to reproduce the behavior:
git clone https://github.com/quarkus-qe/quarkus-test-suite.git- cases
cd quarkus-test-suite/http/jaxrs-reactive && mvn clean verify -Dit.test=MultipartClientITcd quarkus-test-suite/http/rest-client-reactive && mvn clean verify -Dit.test=LargeFileHandlingIT#uploadMultipart
Output of uname -a or ver
No response
Output of java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of mvnw --version or gradlew --version)
No response
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 26 (25 by maintainers)
Commits related to this issue
- RESTEasyReactive: support `@Rest*` annotations on bean params for the client - Also use hyphenate on `@RestHeader` on client fields on bean params #13665 - Added test for client bean param on fields,... — committed to FroMage/quarkus by FroMage 2 years ago
- RESTEasyReactive: support `@Rest*` annotations on bean params for the client - Also use hyphenate on `@RestHeader` on client fields on bean params #13665 - Added test for client bean param on fields,... — committed to FroMage/quarkus by FroMage 2 years ago
- RESTEasyReactive: support `@Rest*` annotations on bean params for the client - Also use hyphenate on `@RestHeader` on client fields on bean params #13665 - Added test for client bean param on fields,... — committed to FroMage/quarkus by FroMage 2 years ago
- RESTEasyReactive: support `@Rest*` annotations on bean params for the client - Also use hyphenate on `@RestHeader` on client fields on bean params #13665 - Added test for client bean param on fields,... — committed to gsmet/quarkus by FroMage 2 years ago
- RESTEasyReactive: support `@Rest*` annotations on bean params for the client - Also use hyphenate on `@RestHeader` on client fields on bean params #13665 - Added test for client bean param on fields,... — committed to gsmet/quarkus by FroMage 2 years ago
OK, I can reproduce it outside the QE tests. It appears to be a problem with the client indeed, not sending anything.
Yes, this must be related to the multipart change. I’ll look.