How to use the api-spec-converter.getFormatName function in api-spec-converter

To help you get started, we’ve selected a few api-spec-converter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github APIs-guru / openapi-directory / scripts / collection.js View on Github external
function writeSpecFromLead(lead,command) {
  var exPatch = _.cloneDeep(lead);
  var origin = util.getOrigin(exPatch);
  if (Array.isArray(origin))
    origin = origin.pop();
  var source = origin.url;
  var format = converter.getFormatName(origin.format, origin.version);

  if (!exPatch.info['x-origin'].length) {
    delete exPatch.info['x-origin'];
  }

  return writeSpec(source, format, exPatch, command);
}

api-spec-converter

Convert API descriptions between popular formats such as OpenAPI(fka Swagger), RAML, API Blueprint, WADL, etc.

MIT
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis