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

When uploading a file in a multipart request, the OpenAPI handler returns a corrupted file #85

Open
gdepourtales opened this issue Oct 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@gdepourtales
Copy link

gdepourtales commented Oct 10, 2024

Version

vert.x 4.5.10

Context

After deploying a OpenAPI contract based api, with a multipart request specification including one file as paranmeter, the file content is larger then the uploaded one. The below code compares the file with two different handlers, the OpenAPI one and the BodyHandler one

Do you have a reproducer?

Please see code here (in Kotlin)

https://gist.github.com/gdepourtales/09598e949ece826aba0f1c95a8fbe40c

Steps to reproduce

With the same PDF file

  1. Build and run the above code
  2. Call http -f POST http://localhost:8080/test_upload_openapi name='name' file@'./EmptyPage.pdf;type=application/octet-stream'
  3. Call http -f POST http://localhost:8080/test_upload_rest name='name' file@'./EmptyPage.pdf;type=application/octet-stream'

The file size printed are not equal even though the upload file is the same

Extra

Running on Linux Ubuntu 24.01
OpenJDK 22, Targetting JVM 17
Kotlin v1.7.21

@gdepourtales gdepourtales added the bug Something isn't working label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant