swagger2openapi
Advanced tools
Comparing version 2.9.3 to 2.9.4
{ | ||
"name": "swagger2openapi", | ||
"version": "2.9.3", | ||
"version": "2.9.4", | ||
"description": "Convert Swagger 2.0 definitions to OpenApi 3.0 and validate", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -185,3 +185,10 @@ // @ts-check | ||
function checkLink(link, options) { | ||
function checkLink(link, openapi, options) { | ||
if (typeof link.$ref !== 'undefined') { | ||
let ref = link.$ref; | ||
should(link.$ref).be.type('string'); | ||
if (options.lint) options.linter('reference',link,'$ref',options); | ||
link = jptr.jptr(openapi, ref); | ||
should(link).not.be.exactly(false, 'Cannot resolve reference: ' + ref); | ||
} | ||
should(link).be.type('object'); | ||
@@ -289,3 +296,3 @@ if (typeof link.operationRef !== 'undefined') { | ||
contextAppend(options, l); | ||
checkLink(response.links[l], options); | ||
checkLink(response.links[l], openapi, options); | ||
options.context.pop(); | ||
@@ -797,3 +804,3 @@ } | ||
if (!link.$ref) { | ||
checkLink(link, options); | ||
checkLink(link, openapi, options); | ||
} | ||
@@ -800,0 +807,0 @@ options.context.pop(); |
319499
7675