-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
MultipartForm is receiving null parameters at the server #27215
Comments
/cc @evanchooly, @geoand |
Can you also attach what the HTTP request looks like (an easy way to do this is from the browser's developer tools)? |
The HTTP request looks like this:
|
|
The |
So this sounds more like a SwaggerUI issue - which makes sense since I don't think we have any support for RESTEasy Reactive multipart handling in OpenAPI |
But sending through curl yields the same error, I tried sending a local file with curl and also got null in both parameters |
If you do not specify a value for |
Yes, but that is generated in Swagger, the problem is that the file contents do not get to the backend |
Any news on this issue? |
Not at the moment. We have a large refactoring of the multipart support we want to get in before making any other changes to it. |
Are there any alternatives I can use to upload images then? |
See my comment above. |
Is there an estimated date for when the refactoring will be done? |
The refactoring has been done and merged in @Sgitario would you like to take another look at this issue? |
With this example, OpenAPI is able to generate an upload button and the content of the file can be read inside my application @POST
@Path("/upload")
@Consumes(MediaType.MULTIPART_FORM_DATA)
fun upload(@PartType(MediaType.APPLICATION_OCTET_STREAM) @Schema(type = SchemaType.STRING, format = "binary") @RestForm description: FileUpload,
@RestForm("image") file: File?
): Uni<Response> {
println(description.uploadedFile().toFile().readText())
println("DONE")
return Uni.createFrom().item(Response.ok().build())
} Thank you |
Describe the bug
When using
resteasy-reactive
in Kotlin (I didn't test with Java), when I have an endpoint like this:With
ImageUploadDto
being:In swagger, content has a button to allow me to upload a file and there is a
file
field which is the JSON mapping of thejava.io.File
class to JSON. I tried withorg.jboss.resteasy.reactive.multipart.FileUpload
but the behavior was the same as usingFile
(except thatFileUpload
is an interface so the JSON mapping was empty).Besides this, when data gets to the server,
content
isnull
as well asFile
(I defined the variables as nullable because I received aNullPointerException
otherwise) as it is able to create anImageUploadDto
instance but the properties are null. I followed the example in the documentation (just adapted it to Kotlin) and it doesn't workExpected behavior
Get the file contents
Actual behavior
Everything is null
How to Reproduce?
Use the example above and try to upload a file
Output of
uname -a
orver
Linux zirconium 5.18.16-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Wed, 03 Aug 2022 11:25:10 +0000 x86_64 GNU/Linux
Output of
java -version
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.11.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Additional information
No response
The text was updated successfully, but these errors were encountered: