Skip to content

Commit b8c928b

Browse files
committed
Update the URL thats passed to remoteRefResolver
1 parent 10741f2 commit b8c928b

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

lib/bundle.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -341,17 +341,6 @@ async function getReferences (currentNode, isOutOfRoot, pathSolver, parentFilena
341341

342342
remoteRefResolutionPromises.push(
343343
new Promise(async (resolveInner) => {
344-
const splitPath = tempRef.split('http'),
345-
urlWithPointer = 'http' + splitPath[splitPath.length - 1],
346-
preProcessedURL = removeLeadingSlash(urlWithPointer.split('#')[0]),
347-
348-
// In cases when the http protocol prefix has single slash,
349-
// we first remove any extra slashes after the protocol
350-
slashRemovedURL = preProcessedURL.replace(/(https?:)\/+/g, '$1/'),
351-
352-
// Then replace any occurrence of http:/ with http://
353-
url = slashRemovedURL.replace(/(https?:)\/([^/])/g, '$1//$2');
354-
355344
function convertToJSONString (content) {
356345
if (typeof content === 'object') {
357346
return JSON.stringify(content);
@@ -362,7 +351,7 @@ async function getReferences (currentNode, isOutOfRoot, pathSolver, parentFilena
362351
return JSON.stringify(parsedFile.oasObject);
363352
}
364353

365-
let contentFromRemote = await remoteRefResolver(url),
354+
let contentFromRemote = await remoteRefResolver(property.$ref),
366355
nodeTemp = {
367356
fileName: tempRef,
368357
path: tempRef,

0 commit comments

Comments
 (0)