Fix (validation) use joi's concat #23

Merged
joeybaker merged 2 commits from fix-joi-concat into master 2016-09-08 20:26:50 +00:00
joeybaker commented 2016-09-08 01:11:04 +00:00 (Migrated from github.com)

It turns out defaultsDeep doesn't ever correctly combine Joi objects.
So, the only option is to use Joi's concat method to combine Joi
schemas. This complicates getConfigForMethod, but simplifies actual
route creation.

I ran into this because I'm setting up lout
on a server, and it requires properly formatted Joi schemas. This leads
me to believe there was something already wrong and Lout just exposed
the problem.

This is a patch release.

It turns out defaultsDeep doesn't ever correctly combine Joi objects. So, the only option is to use Joi's concat method to combine Joi schemas. This complicates `getConfigForMethod`, but simplifies actual route creation. I ran into this because I'm setting up [lout](https://github.com/hapijs/lout) on a server, and it requires properly formatted Joi schemas. This leads me to believe there was something already wrong and Lout just exposed the problem. This is a patch release.
joeybaker commented 2016-09-08 01:12:03 +00:00 (Migrated from github.com)

@mdibaiee I wouldn't mind a second pair of eyes if you get time!

@mdibaiee I wouldn't mind a second pair of eyes if you get time!
mdibaiee commented 2016-09-08 14:14:13 +00:00 (Migrated from github.com)

@joeybaker: oh, I wasn't aware of joi.combine. Thank you, looks good to me. 👍

@joeybaker: oh, I wasn't aware of `joi.combine`. Thank you, looks good to me. :+1:
joeybaker commented 2016-09-08 20:27:51 +00:00 (Migrated from github.com)

Published as 2.6.2

Published as 2.6.2
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: thereadme/hapi-sequelize-crud#23
No description provided.