Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ module.exports = {
* @returns Joi validation Rules
*/
createJoiValidationRules: function(route) {

route.config.validate.body = route.config.validate.payload // hapi compatibility
if (route.config.validate.payload) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is needed as it will be undefined so ignore by JOI

route.config.validate.body = route.config.validate.payload // hapi compatibility
}
const validation = route.config.validate
const types = ['headers', 'params', 'query', 'body']
types.forEach((type) => {
Expand Down