async mapProcessRelatedFiles(
    rootFiles, inputData, origin, version, format, toBundle = false, options = {}, remoteRefResolver
  ) {
    let bundleFormat = format,
      parsedRootFiles = rootFiles.map((rootFile) => {
        let parsedContent = parseFileOrThrow(rootFile.content);
        return { fileName: rootFile.fileName, content: rootFile.content, parsed: parsedContent };
      }).filter((rootWithParsedContent) => {
        let fileVersion = isSwagger(version) ?
          rootWithParsedContent.parsed.oasObject.swagger :
          rootWithParsedContent.parsed.oasObject.openapi;
        return compareVersion(version, fileVersion);
      }),
      data = toBundle ?
        await this.getBundledFileData(parsedRootFiles,
          inputData, origin, bundleFormat, version, options, remoteRefResolver) :
        this.getRelatedFilesData(parsedRootFiles, inputData, origin);

    return data;
  }
@description Takes in root files, input data and origin process every root
to find related files
@param {object} rootFiles - rootFile:{path:string}
@param {array} inputData - [{path:string}]}
@param {string} origin -  process origin
@param {string} version -  process specification version
@param {string} format - the format required by the user
@param {boolean} toBundle - if it will be used in bundle
@param {object} options - a standard list of options that's globally passed around. Check options.js for more.
@param {function} remoteRefResolver - The function that would be called to fetch remote ref contents

@returns {object} root files information and data input