use recursive call to Node._findSchema to handle nested cases

This commit is contained in:
hachichaud 2017-09-13 17:34:39 +02:00
parent 8bc9e8d596
commit b0266d90ab
1 changed files with 2 additions and 2 deletions

View File

@ -2056,13 +2056,13 @@ Node._findSchema = function (schema, path) {
if (typeof key === 'string' && childSchema.properties) { if (typeof key === 'string' && childSchema.properties) {
childSchema = childSchema.properties[key] || null; childSchema = childSchema.properties[key] || null;
if (childSchema) { if (childSchema) {
foundSchema = childSchema; foundSchema = Node._findSchema(childSchema, path.slice(i, path.length));
} }
} }
else if (typeof key === 'number' && childSchema.items) { else if (typeof key === 'number' && childSchema.items) {
childSchema = childSchema.items; childSchema = childSchema.items;
if (childSchema) { if (childSchema) {
foundSchema = childSchema; foundSchema = Node._findSchema(childSchema, path.slice(i, path.length));
} }
} }
} }