evanshortiss/express-joi-validation

How to set {joi: joiOpts}

Closed this issue · 1 comments

Hi!

I mounted this demo to test the joi with i18next and I noticed the following, seeing the file routes/users, line 66, if you remove the comment and run the project, you will notice that only one validation is displayed.

If you run the project with the comment it will show all the validations!

therefore, what is the correct way of doing this configuration to appear all the validations by the express-joi-validation ?

thks!

Hi @carvalhoviniciusluiz, I see what you mean. This appears to be a Joi issue, you can work around it like this with abortEarly:

[changeLanguage, validator.query(querySchema, {joi: {abortEarly: false, language: require('../i18next/locales/pt-BR')}})]

Maybe you can open an issue with Joi? I will close this now - hope that helps!