How to add Joi validation to a input file for uploading image

Viewed 353

I have a input file to upload image with multer. I want to add Joi validation to this Input for uploading images only , Im working with Node.js and Express.js Code :

let schemaValidation = Joi.object({
    name: Joi.string().trim().min(1).required(),
    description: Joi.string().trim().min(1).required(),
    price: Joi.number().positive().required(),
    image: ???????,
    category: Joi.string().trim().min(1).required(),
})
0 Answers
Related