Gathering detailed insights and metrics for swagger-parser
Gathering detailed insights and metrics for swagger-parser
Gathering detailed insights and metrics for swagger-parser
Gathering detailed insights and metrics for swagger-parser
@apidevtools/swagger-parser
Swagger 2.0 and OpenAPI 3.0 parser and validator for Node and browsers
@swagger-api/apidom-parser-adapter-json
Parser adapter for parsing JSON documents into base namespace.
@swagger-api/apidom-parser-adapter-yaml-1-2
Parser adapter for parsing YAML documents into base namespace.
@swagger-api/apidom-parser-adapter-asyncapi-yaml-2
Parser adapter for parsing YAML documents into AsyncAPI 2.x.y namespace.
npm install swagger-parser
Typescript
Module System
Min. Node Version
Node Version
NPM Version
95.5
Supply Chain
93.9
Quality
79
Maintenance
100
Vulnerability
98.9
License
JavaScript (95.98%)
TypeScript (3.81%)
HTML (0.2%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1,150 Stars
715 Commits
165 Forks
19 Watchers
2 Branches
32 Contributors
Updated on Jul 05, 2025
Latest Version
10.0.3
Package Id
swagger-parser@10.0.3
Size
6.76 kB
NPM Version
6.14.12
Node Version
10.24.1
Published on
Aug 15, 2021
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
$ref
pointers, including external files and URLs$ref
pointers$ref
pointers, giving you a normal JavaScript object that's easy to work with$ref
pointers to the same value always resolve to the same object instance1SwaggerParser.validate(myAPI, (err, api) => { 2 if (err) { 3 console.error(err); 4 } 5 else { 6 console.log("API name: %s, Version: %s", api.info.title, api.info.version); 7 } 8});
Or use async
/await
or Promise syntax instead. The following example is the same as above:
1try { 2 let api = await SwaggerParser.validate(myAPI); 3 console.log("API name: %s, Version: %s", api.info.title, api.info.version); 4} 5catch(err) { 6 console.error(err); 7}
For more detailed examples, please see the API Documentation
Install using npm:
1npm install @apidevtools/swagger-parser
When using Swagger Parser in Node.js apps, you'll probably want to use CommonJS syntax:
1const SwaggerParser = require("@apidevtools/swagger-parser");
When using a transpiler such as Babel or TypeScript, or a bundler such as Webpack or Rollup, you can use ECMAScript modules syntax instead:
1import SwaggerParser from "@apidevtools/swagger-parser";
Swagger Parser supports recent versions of every major web browser. Older browsers may require Babel and/or polyfills.
To use Swagger Parser in a browser, you'll need to use a bundling tool such as Webpack, Rollup, Parcel, or Browserify. Some bundlers may require a bit of configuration, such as setting browser: true
in rollup-plugin-resolve.
Full API documentation is available right here
I welcome any contributions, enhancements, and bug-fixes. Open an issue on GitHub and submit a pull request.
To build/test the project locally on your computer:
Clone this repo
git clone https://github.com/APIDevTools/swagger-parser.git
Install dependencies
npm install
Run the build script
npm run build
Run the tests
npm test
Swagger Parser is 100% free and open-source, under the MIT license. Use it however you want.
This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
Thanks to these awesome companies for their support of Open Source developers ❤
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
18 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 6/27 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
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