Skip to content

Commit

Permalink
[server-validator-docs] Update server.validator() documentation to de…
Browse files Browse the repository at this point in the history
…tail child plugins usage
  • Loading branch information
jonathansamines committed Apr 22, 2020
1 parent 07c95da commit a8f5688
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion API.md
Expand Up @@ -2600,7 +2600,9 @@ Registers a server validation module used to compile raw validation rules into v

Return value: none.

Note: the validator is only used when validation rules are not pre-compiled schemas. When a validation rules is a function or schema object, the rule is used as-is and the validator is not used. Note that setting a validator inside a plugin, will cause the validator to only be applied to routes set up by the plugin.
Note: the validator is only used when validation rules are not pre-compiled schemas. When a validation rules is a function or schema object, the rule is used as-is and the validator is not used.

When setting a validator inside a plugin, the validator is only applied to routes set up by the plugin and plugins registered by it. Note that the validator applies only to routes added after it has been set.

```js
const Hapi = require('@hapi/hapi');
Expand Down

0 comments on commit a8f5688

Please sign in to comment.