async generateSeparateFile(asyncapiDocument, name, component, template, fileName, baseDir) {
    const relativeBaseDir = path.relative(this.templateContentDir, baseDir);

    const setFileTemplateNameHookName = 'setFileTemplateName';
    let filename = name;
    if (this.isHookAvailable(setFileTemplateNameHookName)) {
      const filenamesFromHooks = await this.launchHook(setFileTemplateNameHookName, { originalFilename: filename });
      //Use the result of the first hook
      filename = filenamesFromHooks[0];
    } else {
      filename = filenamify(filename, { replacement: '-', maxLength: 255 });
    }

    const newFileName = fileName.replace(`\$\$${template}\$\$`, filename);
    const targetFile = path.resolve(this.targetDir, relativeBaseDir, newFileName);
    const relativeTargetFile = path.relative(this.targetDir, targetFile);
    const shouldOverwriteFile = await this.shouldOverwriteFile(relativeTargetFile);
    if (!shouldOverwriteFile) return;
    //Ensure the same object are parsed to the renderFile method as before.
    const temp = {};
    const key = template === 'everySchema' || template === 'objectSchema' ? 'schema' : template;
    temp[`${key}Name`] = name;
    temp[key] = component;
    await this.renderAndWriteToFile(asyncapiDocument, path.resolve(baseDir, fileName), targetFile, temp);
  }
Generates a file for a component/channel

@private
@param  {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source.
@param  {String} name The name of the component (filename to use)
@param  {Object} component The component/channel object used to generate the file.
@param  {String} template The template filename to replace.
@param  {String} fileName Name of the file to generate for each security schema.
@param  {String} baseDir Base directory of the given file name.
@returns {Promise}