please help with that i am not sure what is happening im using the following:
"body-parser": "1.19.0",
"express": "4.17.1",
"joi": "17.1.1"
but it is only the joi that im having issues with
please help with that i am not sure what is happening im using the following:
"body-parser": "1.19.0",
"express": "4.17.1",
"joi": "17.1.1"
but it is only the joi that im having issues with
Share Improve this question edited Jul 23, 2020 at 12:08 AleksanderGD 4085 silver badges11 bronze badges asked Jul 23, 2020 at 12:02 Xx_RoboMan69Xx_RoboMan69 351 silver badge4 bronze badges3 Answers
Reset to default 8Try schema.validate
instead of Joi.validate
Reference: https://joi.dev/api#example
Joi changed in implementation. You should be validating the schema against your request body.
It should be something like schema.validate(req.body, (err, result) => {} .....)
Did you do :
const Joi = require('joi')
at beginning of this file? Notice the capital J.