Package Exports
- swagger-cli
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 (swagger-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Swagger CLI
Command-line tool to parse, validate, and host Swagger-based REST APIs
| Alpha Code! |------------------------------------- | Swagger CLI is still being written. It's not ready to use yet. Check back later, once we release v1.0.0
Features
- Parse and validate Swagger 2.0 APIs in JSON or YAML format
- Supports multi-file APIs via
$ref
pointers - Bundle multiple Swagger files into one combined Swagger file
- Built-in HTTP server to serve your REST API — great for testing!
- Fully-functional mocks for every operation in your API, including data persistence — great for POCs and demos!
Installation
Install using npm. Install it globally (using the -g
flag) to run it from any terminal window.
npm install -g swagger-cli
Usage
swagger <command> [options] <filename>
Commands:
validate Parses and validates a Swagger file
dereference Dereferences all $ref pointers in a Swagger file
bundle Bundles multiple Swagger files into a single file
serve Serves a Swagger file via a built-in HTTP REST server
Options:
-h, --help Show help for any command
-v, --version Output the CLI version number
Contributing
I welcome any contributions, enhancements, and bug-fixes. File an issue on GitHub and submit a pull request.
Building/Testing
To build/test the project locally on your computer:
Clone this repo
git clone https://github.com/BigstickCarpet/swagger-cli.git
Install dependencies
npm install
Run the build script
npm run build
Run the unit tests
npm run mocha
(just the tests)
npm test
(tests + code coverage)
License
Swagger CLI is 100% free and open-source, under the MIT license. Use it however you want.