diff --git a/lib/resolve-external.js b/lib/resolve-external.js index d84c6bae..074785c8 100644 --- a/lib/resolve-external.js +++ b/lib/resolve-external.js @@ -75,9 +75,10 @@ function crawl (obj, path, $refs, options, external, seen) { if (external && $Ref.is$Ref(obj)) { /* Correct the reference in the external document so we can resolve it */ let withoutHash = url.stripHash(path); - if (url.isFileSystemPath(withoutHash)) { - /* remove file:// from path */ - withoutHash = url.toFileSystemPath(withoutHash); + const isFileUrl = withoutHash.substr(0, 7).toLowerCase() === "file://"; + if (isFileUrl) { + // Strip-off the protocol + withoutHash = withoutHash.substr(7); } obj.$ref = withoutHash + obj.$ref; } diff --git a/package-lock.json b/package-lock.json index 1fb74249..cbe581aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@stoplight/json-schema-ref-parser", - "version": "9.2.5", + "version": "9.2.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@stoplight/json-schema-ref-parser", - "version": "9.2.5", + "version": "9.2.7", "license": "MIT", "dependencies": { "@jsdevtools/ono": "^7.1.3", diff --git a/package.json b/package.json index eb4805e9..4d193b70 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stoplight/json-schema-ref-parser", - "version": "9.2.5", + "version": "9.2.7", "description": "Parse, Resolve, and Dereference JSON Schema $ref pointers", "keywords": [ "json",