oas-validator
Advanced tools
Comparing version 5.0.0 to 5.0.1
18
index.js
@@ -30,9 +30,10 @@ // @ts-check | ||
function validateUrl(s, contextServers, context, options) { | ||
let effSource = options.source || 'http://localhost/'; | ||
if (effSource.indexOf('://') < 0) { | ||
effSource = url.pathToFileURL(effSource); | ||
} | ||
should(s).be.a.String(); | ||
should(s).not.be.Null(); | ||
if (!options.laxurls) should(s).not.be.exactly('', 'Invalid empty URL ' + context); | ||
let base = options.source || 'http://localhost/'; | ||
if (base.indexOf('://') < 0) { | ||
base = url.pathToFileURL(base); | ||
} | ||
let base = effSource; | ||
let variables = {}; | ||
@@ -45,4 +46,7 @@ if (contextServers && contextServers.length) { | ||
for (let v in variables) { | ||
base = base.replace('{'+v+'}',variables[v].default); | ||
base = base.replace('{'+v+'}',variables[v].default); | ||
} | ||
if (base.indexOf('://') < 0) { | ||
base = new URL(base, effSource).toString(); | ||
} | ||
} | ||
@@ -1086,3 +1090,5 @@ } | ||
should(scheme).have.property('flows'); | ||
contextAppend(options,'flows'); | ||
for (let f in scheme.flows) { | ||
contextAppend(options,f); | ||
let flow = scheme.flows[f]; | ||
@@ -1112,3 +1118,5 @@ should(['implicit','password','authorizationCode','clientCredentials'].indexOf(f)).be.greaterThan(-1,'Unknown flow type: '+f); | ||
should(flow.scopes).not.be.an.Array(); | ||
options.context.pop(); | ||
} | ||
options.context.pop(); | ||
} | ||
@@ -1115,0 +1123,0 @@ else { |
{ | ||
"name": "oas-validator", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Parser/validator for OpenAPI 3.x definitions", | ||
@@ -23,3 +23,3 @@ "main": "index.js", | ||
"oas-linter": "^3.2.0", | ||
"oas-resolver": "^2.4.4", | ||
"oas-resolver": "^2.5.0", | ||
"oas-schema-walker": "^1.1.5", | ||
@@ -37,3 +37,3 @@ "reftools": "^1.1.6", | ||
}, | ||
"gitHead": "d4c6b903ab3ef4a94ac3fd8a2b92eaf76b9b7fb6" | ||
"gitHead": "aeaee7225ad2a2ab5e7cce0699cf43854b4d46fa" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65566
1346
Updatedoas-resolver@^2.5.0