lib/api.js
function jsonDescription(format, description) {
  switch (format) {
    case 'application/openapi+json':
      if (typeof description == object) {
        return description;
      } else {
        throw new Error(`application/openapi+json description ${description} is not an object`);
      }
    case 'application/openapi+yaml':
      return yaml.safeLoad(description);
    default:
      throw new Error(`Unknown format: ${format} for ${description}`);
  }
}
function jsonDescription(format, description) {
  switch (format) {
    case 'application/openapi+json':
      if (typeof description == object) {
        return description;
      } else {
        throw new Error(`application/openapi+json description ${description} is not an object`);
      }
    case 'application/openapi+yaml':
      return yaml.safeLoad(description);
    default:
      throw new Error(`Unknown format: ${format} for ${description}`);
  }
}
function jsonDescription ( format , description ) { switch ( format ) { case 'application/openapi+json' : if ( typeof description == object ) { return description ; } else { throw new Error ( ` ${ description } ` ) ; } case 'application/openapi+yaml' : return yaml . safeLoad ( description ) ; default : throw new Error ( ` ${ format } ${ description } ` ) ; } }
private helper methods
private helper methods