express-openapi-validator icon indicating copy to clipboard operation
express-openapi-validator copied to clipboard

Multipart data does not work with latest release (4.13.8)

Open mmberk opened this issue 3 years ago • 4 comments

Describe the bug When calling the post api on a multipart request body, it fails with 4.13.8 but works with 4.13.5.

To Reproduce Here is the request body definition

        requestBody:
            content:
                multipart/form-data:
                    schema:
                        properties:
                            file:
                                type: string
                                format: binary

Actual behavior The data is not captured and saved in the file property

Expected behavior The data should be read from the stream and placed in file property

Examples and context Please see to reproduce section

mmberk avatar Jul 05 '22 20:07 mmberk

I thought I had the same issue but it turns out that the base path (server/url prop) was wrong in my spec and did not match what I was sending... it appears to skip lookup of the config but still match on the controller route.

brendon-stephens avatar Sep 09 '22 06:09 brendon-stephens

multi-files upload is not working when the property is an array and only 1 file is being sent:

picture:
  type: array
  items:
    type: string
    format: binary
  maxItems: 9
  minItems: 1

similar issue described on https://github.com/cdimascio/express-openapi-validator/issues/176 but issue showed up again in latest release

zhi-cloud-ai avatar Jan 19 '23 19:01 zhi-cloud-ai

Same here, not working and throwing error:

Error: Unexpected end of form
    at Multipart._final (/var/local/acp/dashboards/node_modules/busboy/lib/types/multipart.js:588:17)
    at callFinal (node:internal/streams/writable:698:12)
    at prefinish (node:internal/streams/writable:710:7)
    at finishMaybe (node:internal/streams/writable:720:5)
    at Multipart.Writable.end (node:internal/streams/writable:634:5)
    at onend (node:internal/streams/readable:705:10)
    at processTicksAndRejections (node:internal/process/task_queues:77:11)

Bec-k avatar May 26 '23 13:05 Bec-k