eclipse-vertx/vertx-openapi

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

Opened this issue · 0 comments

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