New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@stoplight/json-schema-ref-parser

Package Overview
Dependencies
Maintainers
21
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stoplight/json-schema-ref-parser - npm Package Compare versions

Comparing version

to
9.1.1

17

lib/bundle/defaults.js

@@ -57,2 +57,6 @@ "use strict";

if (!pathFromRoot.startsWith(defaults.defaultRoot) && !isSchemaPlacement(pathFromRoot.split("/"))) {
return null;
}
if (hash !== "#" && hash !== null) {

@@ -74,1 +78,14 @@ return defaults.generateKey(schema, file, normalizeOasSchemasHash(hash, defaults.defaultRoot), pathFromRoot);

}
// this should return true for every place in a OAS document that can reference a JSON Schema model
function isSchemaPlacement (path) {
if (isInOasOperation(path) && path.includes("schema")) {
return true;
}
return false;
}
function isInOasOperation (path) {
return path.length > 3 && path[1] === "paths";
}

2

lib/bundle/index.js

@@ -148,3 +148,3 @@ "use strict";

if (options.bundle.generateKey && file !== $refs._root$Ref.path) {
if (options.bundle.generateKey && file !== $refs._root$Ref.path && !(path.indexOf($refs._root$Ref.path) === 0 && $ref.$ref.indexOf("#/") === 0)) {
if (!customRoots[file]) {

@@ -151,0 +151,0 @@ customRoots[file] = {};

{
"name": "@stoplight/json-schema-ref-parser",
"version": "9.1.0",
"version": "9.1.1",
"description": "Parse, Resolve, and Dereference JSON Schema $ref pointers",

@@ -5,0 +5,0 @@ "keywords": [