mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Avoid reporting local refs
Avoid reporting local refs
This commit is contained in:
committed by
Erik Mendoza
parent
2fea161d84
commit
4a38a70d0b
@@ -8,8 +8,11 @@ const traverseUtility = require('traverse'),
|
||||
* @param {string} key - specified version of the process
|
||||
* @returns {object} - Detect root files result object
|
||||
*/
|
||||
function isRef(obj, key) {
|
||||
return key === '$ref' && typeof obj[key] === 'string' && obj[key] !== undefined;
|
||||
function isExtRef(obj, key) {
|
||||
return key === '$ref' &&
|
||||
typeof obj[key] === 'string' &&
|
||||
obj[key] !== undefined &&
|
||||
!obj[key].startsWith('#');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,7 +40,7 @@ function getReferences (currentNode) {
|
||||
hasReferenceTypeKey = Object.keys(property)
|
||||
.find(
|
||||
(key) => {
|
||||
return isRef(property, key);
|
||||
return isExtRef(property, key);
|
||||
}
|
||||
);
|
||||
if (hasReferenceTypeKey) {
|
||||
|
||||
Reference in New Issue
Block a user