code: function generate(opt) {
  
    var jsonPath;
  
    if (!opt) {
      throw new Error('\'option\' is required.');
    }
  
    if (!opt.basePath) {
       throw new Error('\'basePath\' is required.');
    }
  
    descriptor.basePath = "/" + (opt.apiPrefix) ? opt.apiPrefix : '';
    descriptor.apiVersion = (opt.apiVersion) ? opt.apiVersion :
                                               '1.0';
    descriptor.swagger = (opt.swaggerVersion) ? opt.swaggerVersion :
                                                '1.0';
  
    if(opt.info) {
      descriptor.info = opt.info;
    }
  
    opt.apiVersion = descriptor.apiVersion;
    opt.swagger = descriptor.swaggerVersion;
  
    if (!opt.fullSwaggerJSONPath) {
  
      jsonPath = url.parse(opt.basePath + opt.swaggerJSON).path
      console.log(
        chalk.blue('Swagger info: '),
        chalk.gray('-----------------------------------------------')
      );
      console.log(
        chalk.blue('basePath + swaggerJSON: '),
        chalk.yellow(opt.basePath + opt.swaggerJSON)
      );
      console.log(
        chalk.blue('parsed path to json file: '),
        chalk.yellow(jsonPath)
      );
      if(jsonPath.lastIndexOf('//') !== -1) {
        console.log(
          chalk.red('veriry provided options, there is an unused `//` in the json path')
        );
      }
      console.log(
        chalk.blue('Swagger info: '),
        chalk.gray('-----------------------------------------------')
      );
  
      opt.fullSwaggerJSONPath = jsonPath;
    }
  
    if (opt.apis) {
      opt.apis.forEach(function (api) {
        readYml(api, function (err) {
          if (err) {
            throw err;
          }
        });
      });
    }
  }
docs: Generate Swagger documents