koajs / joi-router

Configurable, input and output validated routing for koa
MIT License
450 stars 96 forks source link

Allow body schema when type is multipart #116

Open ildukm opened 3 years ago

ildukm commented 3 years ago

https://github.com/koajs/joi-router/blob/9fa16b6b183fd095a790445e9bd35dd1e8751a4e/joi-router.js#L240

It throws error when I use type: 'multipart' with body schema.

Should it be allowed to parse multipart/form like below?

form.append('name', 'name');
form.append('image', image); // jpeg image

axios.post(url, form, { headers: { 'Content-type': 'multipart/form-data' });