Socket
Socket
Sign inDemoInstall

oas-resolver

Package Overview
Dependencies
57
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.1.0

22

index.js

@@ -13,2 +13,3 @@ 'use strict';

const clone = require('reftools/lib/clone.js').clone;
const deRef = require('reftools/lib/dereference.js').dereference;
const isRef = require('reftools/lib/isref.js').isRef;

@@ -32,3 +33,3 @@ const common = require('oas-kit-common');

function resolveAllInternal(obj, context, src, parentPath, base, options) {
function resolveAllFragment(obj, context, src, parentPath, base, options) {

@@ -47,3 +48,3 @@ let attachPoint = options.externalRefs[src+parentPath].paths[0];

let target = clone(jptr(context, obj[key]));
if (options.verbose>1) console.log((target === false ? common.colour.red : common.colour.green)+'Internal resolution', obj[key], common.colour.normal);
if (options.verbose>1) console.log((target === false ? common.colour.red : common.colour.green)+'Fragment resolution', obj[key], common.colour.normal);
/*

@@ -58,3 +59,3 @@ ResolutionCase:A is where there is a local reference in an externally

if (options.fatal) {
let ex = new Error('Internal $ref resolution failed '+obj[key]);
let ex = new Error('Fragment $ref resolution failed '+obj[key]);
if (options.promise) options.promise.reject(ex)

@@ -107,3 +108,3 @@ else throw(ex);

if (options.verbose>1) console.log('Finished internal resolution');
if (options.verbose>1) console.log('Finished fragment resolution');
return obj;

@@ -163,3 +164,3 @@ }

}
data = resolveAllInternal(data, context, pointer, fragment, target, options);
data = resolveAllFragment(data, context, pointer, fragment, target, options);
data = filterData(data, options);

@@ -208,3 +209,3 @@ callback(clone(data), target, options);

}
data = resolveAllInternal(data, context, pointer, fragment, target, options);
data = resolveAllFragment(data, context, pointer, fragment, target, options);
data = filterData(data, options);

@@ -248,3 +249,3 @@ }

}
data = resolveAllInternal(data, context, pointer, fragment, target, options);
data = resolveAllFragment(data, context, pointer, fragment, target, options);
data = filterData(data, options);

@@ -429,3 +430,8 @@ }

else {
if (options.verbose>1) console.log(common.colour.yellow+'Finished resolution!',common.colour.normal);
if (options.verbose>1) console.log(common.colour.yellow+'Finished external resolution!',common.colour.normal);
if (options.resolveInternal) {
if (options.verbose>1) console.log(common.colour.yellow+'Starting internal resolution!',common.colour.normal);
options.openapi = deRef(options.openapi,options.original,{verbose:options.verbose-1});
if (options.verbose>1) console.log(common.colour.yellow+'Finished internal resolution!',common.colour.normal);
}
res(options);

@@ -432,0 +438,0 @@ }

{
"name": "oas-resolver",
"version": "2.0.0",
"version": "2.1.0",
"description": "Resolve external $refs in OpenAPI (swagger) 2.0 / 3.x definitions",

@@ -24,3 +24,3 @@ "main": "index.js",

"oas-kit-common": "^1.0.7",
"reftools": "^1.0.5",
"reftools": "^1.0.6",
"yaml": "^1.2.0",

@@ -36,3 +36,3 @@ "yargs": "^12.0.2"

},
"gitHead": "92ab5dd327dca2f6c64c86606a86e62962c66663"
"gitHead": "7266231ceaa819076249f3722d926f3685637c50"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc