Closed Nikola-Milovic closed 2 years ago
What is the problem you are seeing? What is happening or not happening that you expect?
@arb Not really a problem just a question, if I append to form data a JSON string, it's not being parsed as a JSON object but rather as a string. So I was wondering if the type we put in the FormData does it matter or not? As in the above case type: "application/json"
was considered a string either way. But after looking into it a bit more I think it's more so Multers thing as it's parsing the body first and then passing it onto the celebrate middleware.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello everyone, trying to wrap my head around how to approach this. On my client I send a file and some data alongside that, using FormData, the other data is an object with JSON.stringify around it. This doesn't seem to be picked up by the Joi validator as it expects it to be a string and not an object.
In my client
And my server
There are hacky ways around this, but interested in genuine solutions