express-openapi-validator
express-openapi-validator copied to clipboard
Feature: Extendable fileUploader #248
Feature: Extendable fileUploader #248
@Haruki-Mortis @cdimascio I don't want to be bound to multer.any() as well and want to be able to provide custom uploader. My approach to implementing this is really simple. We can simply extend the fileUploader with an another prop, let's say uploadHandler, that is a function returned by multer().single("image") for example. Then instead of:
multer.any()(req, res, next) {...}.
we can do:
options.multOpts.uploadHandler(req, res, next) {...}
This is straightforward to implement and gives the user the ability to use multer without restrictions. I have already implemented and tested this approach exemplary, works fine. What do you say? Is this worth a PR?
@Haruki-Mortis good idea. this will provide good flexibility
Hello, any news on this ? I would like to use a custom implementation of multer too, to allow use of upload without multipart, like described here https://swagger.io/docs/specification/describing-request-body/file-upload/ Let me know if a new PR is welcome on this. PS: Thanks for this great tool you built !
@devthejo I support the idea and welcome PRs.