Closed Celadora closed 7 years ago
I'm starting to think this is a problem with bagpipes and not Swagger, sorry for the confusion.
I don't understand: Where is this error coming from? Is it a Swagger validation error? Or is it a Multer error?
I think it's a Swagger validation error, Multer doesn't get reached if this error is thrown. Edit: and the error is only thrown if I have that parameter, regardless of whether it is required.
If it's an issue with Swagger validation, most likely this is something that will need to be addressed in Sway. https://github.com/apigee-127/sway
I'll try reposting there if I can't find a solution. Thank you!
It seems like swagger is ignoring the option to not require a parameter when that parameter is a file.
Error: req.files must be provided for 'formData' parameters of type 'file'
If I remove the parameter everything works fine, and multer can process the file.
Note: the solution of putting multer (or other file parsing middleware) before swagger isn't suitable, however, because not all requests are going to have a file, and the processing of different paths may require different middle ware solutions.