-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Invalid schema content: (email.$_root.alternatives) with Joi 16 #2107
Comments
Can you try wrapping it into an object like so: payload: Joi.object({
email: Joi.string()
.email()
.allow(null, '')
.optional(),
id: Joi.string(),
firstName: Joi.string(),
lastName: Joi.string(),
}), |
@Marsup Thank you for hint but no help=((
|
Can you show the stacktrace with the updated code ? |
sure=)
|
Are you sure all your modules are up to date ? Which version of hapi are you using ? |
I'm having the exact same issue. I've tried wrapping it in In |
I have the same issue, nothing is working. |
Sorry, for late response |
The entire validation API has been changed. hapi needs an update to support it. Coming later today. |
We have to wait until "later today"? How dare you make us wait!!! We need it now!!! :) Thanks for the update. |
for quick solution, just downgrade into |
#2107 (comment) @hbinduni's solution worked for me, as well. |
When will we be able to use joi 16 with hapi? |
hapi v18.4.0 supports joi v16. You must wrap the top level schema with |
Downgrading worked for me |
Come on, @hueniverse just posted the solution above... |
Probado con hapi 18.4 y Joi 161.4 ..... { |
@jsconestilo Support is only available in English. |
Context
What are you trying to achieve or the steps to reproduce ?
I'm using Joi as a validator of payload for route like this:
Which result you had ?
I have this exception in my console on app start:
What did you expect ?
I expect it works as it did with 15 version
The text was updated successfully, but these errors were encountered: