Skip to content

Commit 6eb73c3

Browse files
fix(schema.js): fix $ref not being resolved when nested deeper than once within an object
A $ref is not correctly resolved when nested within objects deeper than depth 2. Go recursively over any object properties that are themselves objects to look for a $ref. fix #155
1 parent 80f6dd8 commit 6eb73c3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/schema.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ var processFurther = Promise.method(function(val, key, $id){
125125
}
126126
});
127127
});
128+
} else {
129+
//type is object but property does not contain a $ref
130+
// go recursively down to check for a $ref
131+
return processFurther(propertyValue, propertyKey, base$id);
128132
}
129133
});
130134

0 commit comments

Comments
 (0)