Open JaekwanLee opened 6 years ago
I don't disagree. I do think that sway
aims to try to give a convention and it wouldn't take much to work around this but at the same time, I can make sway
smarter to treat req.file
as an array with req.file
in it. I'll get working on it.
With a formData parameter named for example as file
, the parameter validation fails when it is required. This is do to req.files[this.name]
returning undefined, as it is an array not an object.
Both req.body
and req.fields
use the parameter name, and may be better suited to get the parameter value.
This will be sorted soon, sorry for the delay.
It seems weird to see file type of formData is always expected under req.files. I see multer(a popular library for multi-part form data) sometimes use req.file for a single file.
In lib/types/parameter.js, it always throws an error due to validation failure.
Should it be more generous in the case of formData?