bo-swag
A lightweight solution to create swagger documentation with ExpressJS
Status: Work in progress
Installation
npm install bo-swag --save
DRY.
Just wrap your ExpressJS app or router. All origin functions are still available!!
var express = swag = app = swag;
Standard call of .get, .use. or other verbs works as expected and generate NO API doc for you:
app
But if you provide a small documentation hint this project will automatically generate an API doc for you:
// Name => Standard JSON-schemeapp; appapp
This exmaple show how you can use multiple attributs. Expect
some shortcuts like body
you can use all swagger documentation
attributes here!
Shortcuts? Yes! body: 'A String'
is a shortcut and will be
automatically expanded to parameters: [ { in: 'body', name: 'body', schema: { $ref: '#/definitions/A String' } } ]
.
app
If you want load your definitions from an external spec javascript or json file, you can merge your input easily:
appspec;
To include the swagger-ui (static HTML and a dynamically generated swagger.json) just include the middleware.
app;