function convert(swaggerData) {
  let options = {},
    convertFn = interfaceVersion === 'v1' ? 'convert' : 'convertV2';

  // apply options from config file if present
  if (configFile) {
    configFile = path.resolve(configFile);
    console.log('Options Config file: ', configFile); // eslint-disable-line no-console
    options = JSON.parse(fs.readFileSync(configFile, 'utf8'));
  }

  // override options provided via cli
  if (definedOptions && !_.isEmpty(definedOptions)) {
    options = definedOptions;
  }

  Converter[convertFn]({
    type: 'string',
    data: swaggerData
  }, options, (err, status) => {
    if (err) {
      return console.error(err);
    }
    if (!status.result) {
      console.log(status.reason); // eslint-disable-line no-console
      process.exit(0);
    }
    else if (outputFile) {
      let file = path.resolve(outputFile);
      console.log('Writing to file: ', prettyPrintFlag, file, status); // eslint-disable-line no-console
      writetoFile(prettyPrintFlag, file, status.output[0].data);
    }
    else {
      console.log(status.output[0].data); // eslint-disable-line no-console
      process.exit(0);
    }
  });
}
Helper function for the CLI to convert swagger data input
@param {String} swaggerData - swagger data used for conversion input
@returns {void}