async detectRelatedFiles() {
    const input = this.input;

    schemaUtils.validateInputMultiFileAPI(input);
    if (!input.rootFiles || input.rootFiles.length === 0) {
      let rootFiles = await this.detectRootFiles(input);
      if (rootFiles.output.data) {
        let inputContent = [];
        rootFiles.output.data.forEach((rootFile) => {
          let founInData = input.data.find((dataFile) => { return dataFile.fileName === rootFile.path; });
          if (founInData) {
            inputContent.push({ fileName: founInData.fileName, content: founInData.content });
          }
        });
        input.rootFiles = inputContent;
        return schemaUtils.processRelatedFiles(input);
      }
    }

    let adaptedRootFiles = input.rootFiles.map((rootFile) => {
      let foundInData = input.data.find((file) => { return file.fileName === rootFile.path; });
      if (!foundInData) {
        return undefined;
      }
      return { fileName: rootFile.path, content: foundInData.content };
    }).filter((rootFile) => { return rootFile !== undefined; });
    if (adaptedRootFiles.length === 0) {
      throw new Error('Root file content not found in data array');
    }

    input.rootFiles = adaptedRootFiles;
    return schemaUtils.processRelatedFiles(input);
  }
@description Takes in a folder and identifies the related files from the
root file perspective (using $ref property)

@returns {object} root files information and data input