1.0.0 • Published 9 months ago
express-autodoc v1.0.0
express-autodoc
API documentation generator based on jsdoc comments for express
Quick start
Install
npm install express-autodoc --save-dev
Add documentation for your Express.js endpoint
/**
* @description Get songs
* @queryParam (title) The song title
* @pathParam (:albumId) album UUID
* @produces application/json, application/xml
*/
app.get('/api/albums/:albumId/songs', (req, res) => (
res.json({
title: req.title,
})
));
Generate swagger mapping
node -e 'require("express-autodoc").generateSwagger(".")'
Supported tags
Tag | Format | Example | |
---|---|---|---|
@queryParam | (\<name>) {type: string, required: true, default: \<defaultValue> } \<description> | /** @queryParam (name) A name param */ | |
@pathParam | (\<:name>) \<description> | /** @pathParam (:id) song Id */ | |
@produces | \<contentType1>,\<contentTypeN> | /** @produces application/json */ | |
@description | \<description> | /** @description A description */ | |
@body, @request | \<body> [{"example": "object"} | ] | /** @body {} */ /** @body #definitions/Song */ |
@response | \<response> [{"example": "object"} | ] | /** @response {} */ /** @response #definitions/Song */ |
See more examples: simple app, app with router
1.0.0
9 months ago
0.0.16
9 months ago
0.0.15
9 months ago
0.0.14
1 year ago
0.0.13
1 year ago
0.0.12
1 year ago
0.0.12-0
2 years ago
0.0.11-0
2 years ago
0.0.10-0
2 years ago
0.0.9-0
2 years ago
0.0.8-0
2 years ago
0.0.7-0
2 years ago
0.0.6-0
2 years ago
0.0.5-0
2 years ago
0.0.4-0
2 years ago
0.0.3-0
2 years ago
0.0.2-0
2 years ago
0.0.1-alpha.0
2 years ago