swagger-jsdoc-deref

1.1.0 • Public • Published

swagger-jsdoc-deref

CircleCI codecov Greenkeeper badge

A CLI that uses swagger-jsdoc and json-refs to generate an OpenAPI/Swagger definition file from JSDoc-like comments, but allows for arbitrary references and dereferences them in the output document. This is particularly useful when working with certain consumers of OpenAPI that don't parse json references.

Installation

npm install swagger-jsdoc-deref

Usage

From a console using npx

npx swagger-jsdoc-deref -d ./path/to/definition/file.js -o ./other-path/output.json

In your package.json file:

{
  "scripts": {
    "generate-docs": "swagger-jsdoc-deref -d ./path/to/definition/file.js -o ./other-path/output.json"
  }
}

Additional API Snippets

You can also provide additional API snippets from yaml files by providing additional file arguments:

npx swagger-jsdoc-deref -d ./path/to/definition/file.js -o ./other-path/output.json ./path/to/api/snippet.yaml

In your package.json file:

{
  "scripts": {
    "generate-docs": "swagger-jsdoc-deref -d ./path/to/definition/file.js -o ./other-path/output.json ./path/to/api/snippet.yaml"
  }
}

Test

npm test

License

MIT

Package Sidebar

Install

npm i swagger-jsdoc-deref

Weekly Downloads

4

Version

1.1.0

License

MIT

Unpacked Size

19.5 kB

Total Files

17

Last publish

Collaborators

  • msluther