You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@fabricio-godoi Were you sending through an accept header on your requests? I recently found in my own projects that the form data parsing fails if an accept header that is not "multipart/form-data" or "application/x-www-form-urlencoded" is sent on the request.
It seems like the accept header is incorrectly being used to determine whether the request will have form data or not; instead of the content-type header.
It will work as intended if no accept header is sent, or if an accept header like "*/*", "application/*" or "multipart/*" is used. However doing that as a work around seems ill advised.
@russell-matt I was not providing the accept header, just the "content-type": "multipart/form-data".
For now, I set the field as not required since I could not configure it properly, but I`ll keep in mind that workaround in future releases.
But the problem is with the swagger web interface that does not set up the accept header, so this workaround will not resolve all my problems 😞
I hope that is fixed in the feature releases. Thank you for your response 😄
Greetings everyone,
I'm having problem when validation formData file upload with multer and swaggerRoutes.
swagger.yml
The swaggerRoutes method returns this when validating the "required: true":
"message": "formData requires property \"document\""
If I set required as false, the swaggerRotues continues without any problem.
Anyone have any ideas how to solve this?
The text was updated successfully, but these errors were encountered: