hapi
hapi copied to clipboard
Validation of parameters, meaning of "true"
Context
- node version: n/a
- module version: n/a (latest)
What are you trying to achieve or the steps to reproduce ?
The validate option has a default value of:
{ headers: true, params: true, query: true, payload: true, state: true, failAction: 'error' }
If a key has a value of
true, there will be no validation.
Is this accurate? It is surprising that validate: { headers: true } means "don't validate headers."
Maybe it is trying to say that true means that the headers are always considered valid, which makes a lot more sense. Rather than validation is disabled or skipped.
It is explained in this section of the Documentation.