oas-resolver
Advanced tools
Comparing version 1.0.1 to 1.0.4
13
index.js
@@ -102,2 +102,10 @@ 'use strict'; | ||
function filterData(data, options) { | ||
if (!options.filters || !options.filters.length) return data; | ||
for (let filter of options.filters) { | ||
data = filter(data, options); | ||
} | ||
return data; | ||
} | ||
function resolveExternal(root, pointer, options, callback) { | ||
@@ -134,2 +142,3 @@ var u = url.parse(options.source); | ||
data = resolveAllInternal(data, context, pointer, fragment, target, options); | ||
data = filterData(data, options); | ||
callback(clone(data), target, options); | ||
@@ -144,2 +153,4 @@ return Promise.resolve(data); | ||
.then(function (data) { | ||
data = filterData(data, options); | ||
options.cache[target] = data; | ||
callback(data, target, options); | ||
@@ -169,2 +180,3 @@ return data; | ||
data = resolveAllInternal(data, context, pointer, fragment, target, options); | ||
data = filterData(data, options); | ||
} | ||
@@ -198,2 +210,3 @@ catch (ex) { | ||
data = resolveAllInternal(data, context, pointer, fragment, target, options); | ||
data = filterData(data, options); | ||
} | ||
@@ -200,0 +213,0 @@ catch (ex) { |
{ | ||
"name": "oas-resolver", | ||
"version": "1.0.1", | ||
"version": "1.0.4", | ||
"description": "Resolve external $refs in OpenAPI (swagger) 2.0 / 3.x definitions", | ||
@@ -24,7 +24,7 @@ "main": "index.js", | ||
"node-fetch": "^2.1.1", | ||
"oas-kit-common": "^1.0.0", | ||
"oas-kit-common": "^1.0.3", | ||
"reftools": "^1.0.0", | ||
"yargs": "^11.0.0" | ||
}, | ||
"gitHead": "01dfb3463b23f9480db05cc75b1143549224e829" | ||
"gitHead": "35db8259dbe6591e05c9645bb183e1f1f39a85ff" | ||
} |
@@ -1,1 +0,1 @@ | ||
# openapi-resolver | ||
# oas-resolver |
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
21424
430
Updatedoas-kit-common@^1.0.3