JSPM

  • Created
  • Published
  • Downloads 26087
  • Score
    100M100P100Q145187F
  • License MIT

Convert between API description formats such as Swagger and RAML

Package Exports

  • api-spec-converter

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (api-spec-converter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

api-spec-converter

Join the chat at https://gitter.im/lucybot/api-spec-converter

NPM version Build status Code climate Dependency status devDependency status

Convert between API description formats such as Swagger and RAML

Currently only supports conversion to Swagger 2.0

Installation

Command Line

npm install -g api-spec-converter

NodeJS

npm install --save api-spec-converter

Usage

Command Line

api-spec-converter <URL|filename> --from type_1 --to type_2 > output_spec

e.g.

api-spec-converter https://api.gettyimages.com/swagger/api-docs --from=swagger_1 --to=swagger_2 > swagger.json

NodeJS

var Converter = require('api-spec-converter');
Converter.convert({
  from: 'swagger_1',
  to: 'swagger_2',
  source: 'https://api.gettyimages.com/swagger/api-docs',
}, function(err, converted) {
  console.log(converted.spec);
  FS.writeFileSync('swagger2.json', converted.stringify());
})

Supported Types

Conversion Table

from: swagger_1 swagger_2 io_docs api_blueprint google raml wadl
to swagger_1 n/a
to swagger_2 n/a
to io_docs n/a
to api_blueprint n/a
to google n/a
to raml n/a
to wadl n/a

Contributing

Contributions are welcome. I'll try to respond to pull requests within 24 hours.