Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RESTEasy Reactive Multipart Json Upload doesn't work for files #19677

Closed
andreas-eberle opened this issue Aug 26, 2021 · 3 comments · Fixed by #19684
Closed

RESTEasy Reactive Multipart Json Upload doesn't work for files #19677

andreas-eberle opened this issue Aug 26, 2021 · 3 comments · Fixed by #19684
Labels
area/rest triage/invalid This doesn't seem right
Milestone

Comments

@andreas-eberle
Copy link
Contributor

Describe the bug

I try to use RestEasy Reactive's Multipart upload to upload a json file and want to get the parsed contents in my multipart Dto. This works fine if directly send json in the part but it doesn't work if the part is a file containing json.

Expected behavior

Should be the same for json files and for "inline" json.

Actual behavior

No response

How to Reproduce?

Reproducer:
2021-08-26_resteasy-reactive-multipart-json-file.zip

  1. Download, unzip, start with ./gradlew quarkusDev
  2. Run curl command curl --location --request POST 'localhost:8080/hello' --form 'jsonFilePart=@"./multipart-test.json";type=application/json' --form 'jsonPart="{\"name\": \"Json without file part\" }";type=application/json' (the file multpart-test.json is included in the reproducer project)
  3. You will get a response like this {"jsonFilePart":null,"jsonPart":{"name":"Json without file part"}}
  4. Expected result: The jsonFilePart contains the contents of the multipart-test.json file.

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

2.1.3

Build tool (ie. output of mvnw --version or gradlew --version)

gradle

Additional information

No response

@andreas-eberle andreas-eberle added the kind/bug Something isn't working label Aug 26, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 26, 2021

/cc @FroMage, @geoand, @stuartwdouglas

@geoand
Copy link
Contributor

geoand commented Aug 26, 2021

This is the expected behavior actually.

When you upload a file, the field is not populated with the value. Instead, you should use FileUpload as the field type.

The fact that there is no actionable information however is not ideal. I'll look into adding something

geoand added a commit to geoand/quarkus that referenced this issue Aug 26, 2021
geoand added a commit to geoand/quarkus that referenced this issue Aug 26, 2021
@geoand geoand changed the title RestEasy Reactive Multipart Json Upload doesn't work for files RESTEasy Reactive Multipart Json Upload doesn't work for files Aug 26, 2021
@geoand geoand added triage/invalid This doesn't seem right and removed kind/bug Something isn't working labels Aug 26, 2021
@geoand
Copy link
Contributor

geoand commented Aug 26, 2021

#19684 adds a debug log message for this case

geoand added a commit to geoand/quarkus that referenced this issue Aug 28, 2021
geoand added a commit that referenced this issue Aug 30, 2021
Add an actionable message when attribute of multipart is a file and not accessed as such
@quarkus-bot quarkus-bot bot added this to the 2.3 - main milestone Aug 30, 2021
@gsmet gsmet modified the milestones: 2.3 - main, 2.2.1.Final Aug 30, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest triage/invalid This doesn't seem right
Projects
None yet
3 participants