Closed brock8503 closed 10 years ago
Here is a particular testcase where lout is failing on a rule object that is not an Array.
validate: { payload: { param1: Joi.array().includes( Joi.object( { param2: Joi.array().includes( Joi.object( { param3 : Joi.string() } ) ).optional() } ) ) } } }
Simple fix would be to add protection, but I don't think that is the ideal solution.
@ln 193 index.js } else if (data.type === 'array' && param.rules) { data.rules = {}; param.rules.forEach(function (rule) { var capitalizedName = rule.name.charAt(0).toUpperCase() + rule.name.slice(1); if (Array.isArray(params.rule)) { data.rules[capitalizedName] = !Array.isArray(rule.arg) ? rule.arg : rule.arg.map(function (type) { return internals.getParamsData(internals.describe(type)); }); } });
And you're right, I did an awful mistake in 3.1.1. Publishing a fix in the next few minutes.
OK the fix is now live on npm, sorry for letting this one slip.
Here is a particular testcase where lout is failing on a rule object that is not an Array.
Simple fix would be to add protection, but I don't think that is the ideal solution.