Closed AdamAld closed 2 years ago
A workaround is to abortEarly: false
as part of the joiOpts:
That mode just controls if celebrate
should validate the all the segments of a request. Normally, it fails on the first segment that is invalid (just like hapi does). The abortEarly
option is used to control if Joi will abort on the first error or not. The two are not really related directly and mixing and matching them is possible.
Ahh, I see! I was conflating the two - Celebrate FULL
mode and Joi abortEarly
- as having the same operational outcome.
Thank you!
node
version - v6.14.13celebrate
version - v15.0.0joi
version (vianpm ls --depth=0 | grep joi
) -My celebrate definition and
joi
schema looks like this:Here is an example value that is not working as expected:
N/A
The issue I am having with
celebrate
is:Passing
{ mode: Modes.FULL }
as the opts parameter to thecelebrate
function - or the curried version viacelebrator
- does not override the default value ofModes.PARTIAL
.