Gathering detailed insights and metrics for swagger-jsdoc
Gathering detailed insights and metrics for swagger-jsdoc
Gathering detailed insights and metrics for swagger-jsdoc
Gathering detailed insights and metrics for swagger-jsdoc
@types/swagger-jsdoc
TypeScript definitions for swagger-jsdoc
next-swagger-doc
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
express-jsdoc-swagger
Swagger OpenAPI 3.x generator
swagger-jsdoc-webpack-plugin
A webpack plugin to generate a swagger.json file from jsdoc
Generates swagger/openapi specification based on jsDoc comments and YAML files.
npm install swagger-jsdoc
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (97.26%)
CSS (2.74%)
Total Downloads
94,707,936
Last Day
38,181
Last Week
663,884
Last Month
2,713,758
Last Year
30,165,529
MIT License
1,749 Stars
442 Commits
230 Forks
10 Watchers
6 Branches
67 Contributors
Updated on Jul 01, 2025
Minified
Minified + Gzipped
Latest Version
6.2.8
Package Id
swagger-jsdoc@6.2.8
Unpacked Size
695.14 kB
Size
296.78 kB
File Count
58
NPM Version
6.14.16
Node Version
12.22.12
Published on
Jan 16, 2023
Cumulative downloads
Total Downloads
Last Day
30.4%
38,181
Compared to previous day
Last Week
-5.7%
663,884
Compared to previous week
Last Month
4.3%
2,713,758
Compared to previous month
Last Year
44.8%
30,165,529
Compared to previous year
This library reads your JSDoc-annotated source code and generates an OpenAPI (Swagger) specification.
Imagine having API files like these:
1/** 2 * @openapi 3 * /: 4 * get: 5 * description: Welcome to swagger-jsdoc! 6 * responses: 7 * 200: 8 * description: Returns a mysterious string. 9 */ 10app.get('/', (req, res) => { 11 res.send('Hello World!'); 12});
The library will take the contents of @openapi
(or @swagger
) with the following configuration:
1const swaggerJsdoc = require('swagger-jsdoc'); 2 3const options = { 4 definition: { 5 openapi: '3.0.0', 6 info: { 7 title: 'Hello World', 8 version: '1.0.0', 9 }, 10 }, 11 apis: ['./src/routes*.js'], // files containing annotations as above 12}; 13 14const openapiSpecification = swaggerJsdoc(options);
The resulting openapiSpecification
will be a swagger tools-compatible (and validated) specification.
You are viewing swagger-jsdoc
v6 which is published in CommonJS module system.
1npm install swagger-jsdoc --save
Or
1yarn add swagger-jsdoc
By default swagger-jsdoc
tries to parse all docs to it's best capabilities. If you'd like to you can instruct an Error to be thrown instead if validation failed by setting the options flag failOnErrors
to true
. This is for instance useful if you want to verify that your swagger docs validate using a unit test.
1const swaggerJsdoc = require('swagger-jsdoc'); 2 3const options = { 4 failOnErrors: true, // Whether or not to throw when parsing errors. Defaults to false. 5 definition: { 6 openapi: '3.0.0', 7 info: { 8 title: 'Hello World', 9 version: '1.0.0', 10 }, 11 }, 12 apis: ['./src/routes*.js'], 13}; 14 15const openapiSpecification = swaggerJsdoc(options);
Click on the version you are using for further details:
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
all changesets reviewed
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
49 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More