Skip to content

Commit

Permalink
Merge pull request #53 from stoplightio/fix/2385-external-ref-resolution
Browse files Browse the repository at this point in the history
add check to not convert actual urls
  • Loading branch information
mmarti21 authored Oct 9, 2023
2 parents 8d19b3b + b72c855 commit 79a8cda
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/resolve-external.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ function crawl (obj, path, $refs, options, external, seen) {
else {
if (external && $Ref.is$Ref(obj)) {
/* Correct the reference in the external document so we can resolve it */
let withoutHash = url.stripHash(path);
obj.$ref = url.toFileSystemPath(withoutHash) + obj.$ref;
const withoutHash = url.stripHash(path);
const externalRef = url.isHttp(withoutHash)
? withoutHash
: url.toFileSystemPath(withoutHash);
obj.$ref = externalRef + obj.$ref;
}

for (let key of Object.keys(obj)) {
Expand Down

0 comments on commit 79a8cda

Please sign in to comment.