Skip to content

Commit

Permalink
fix(schema.js): fix $ref not being resolved when nested deeper than o…
Browse files Browse the repository at this point in the history
…nce 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
  • Loading branch information
matthias-pichler committed Jul 26, 2019
1 parent 80f6dd8 commit 6eb73c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ var processFurther = Promise.method(function(val, key, $id){
}
});
});
} else {
//type is object but property does not contain a $ref
// go recursively down to check for a $ref
return processFurther(propertyValue, propertyKey, base$id);
}
});

Expand Down

0 comments on commit 6eb73c3

Please sign in to comment.