correctly use Joi.object().keys(), finally

This commit is contained in:
Joe Fleming 2016-03-18 12:44:31 -07:00
parent 41e30817ff
commit 21520477cf

View file

@ -187,10 +187,9 @@ module.exports = class Config {
getSchema() {
if (!this[schema]) {
this[schema] = (function convertToSchema(children) {
let objKeys = Object.keys(children);
let schema = Joi.object().keys(objKeys).default();
let schema = Joi.object().keys({}).default();
for (const key of objKeys) {
for (const key of Object.keys(children)) {
const child = children[key];
const childSchema = _.isPlainObject(child) ? convertToSchema(child) : child;