diff --git a/lib/schemaRegistry.js b/lib/schemaRegistry.js index 6e3f0b0..77180f2 100644 --- a/lib/schemaRegistry.js +++ b/lib/schemaRegistry.js @@ -104,7 +104,10 @@ SchemaRegistry._gatherRefs = function(obj) { do { if (Object.prototype.hasOwnProperty.call(currentObj, '$ref')) { - result.push(currentObj.$ref); + var currentObjRef = currentObj.$ref; + if ( typeof currentObjRef === "string" ) { + result.push(currentObj.$ref); + } } var keys = Object.keys(currentObj);