Gathering detailed insights and metrics for @apidevtools/openapi-schemas
Gathering detailed insights and metrics for @apidevtools/openapi-schemas
Gathering detailed insights and metrics for @apidevtools/openapi-schemas
Gathering detailed insights and metrics for @apidevtools/openapi-schemas
@apidevtools/swagger-parser
Swagger 2.0 and OpenAPI 3.0 parser and validator for Node and browsers
swagger-parser
Swagger 2.0 and OpenAPI 3.0 parser and validator for Node and browsers
openapi-schemas
JSON Schemas for every version of the OpenAPI Specification
@apidevtools/json-schema-ref-parser
Parse, Resolve, and Dereference JSON Schema $ref pointers
JSON Schemas for every version of the OpenAPI Specification
npm install @apidevtools/openapi-schemas
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
34 Stars
47 Commits
5 Forks
3 Watching
1 Branches
5 Contributors
Updated on 20 Aug 2024
JavaScript (56.92%)
TypeScript (43.08%)
Cumulative downloads
Total Downloads
Last day
-12.5%
366,423
Compared to previous day
Last week
0.9%
1,930,540
Compared to previous week
Last month
15.5%
8,158,939
Compared to previous month
Last year
45.4%
80,375,275
Compared to previous year
This package contains the official JSON Schemas for every version of Swagger/OpenAPI Specification:
Version | Schema | Docs |
---|---|---|
Swagger 1.2 | v1.2 schema | v1.2 docs |
Swagger 2.0 | v2.0 schema | v2.0 docs |
OpenAPI 3.0.x | v3.0.x schema | v3.0.3 docs |
OpenAPI 3.1.x | v3.1.x schema | v3.1.0 docs |
All schemas are kept up-to-date with the latest official definitions via an automated CI/CD job. 🤖📦
You can install OpenAPI Schemas via npm.
1npm install @apidevtools/openapi-schemas
The default export contains all OpenAPI Specification versions:
1const openapi = require("@apidevtools/openapi-schemas"); 2 3console.log(openapi.v1); // { $schema, id, properties, definitions, ... } 4console.log(openapi.v2); // { $schema, id, properties, definitions, ... } 5console.log(openapi.v3); // { $schema, id, properties, definitions, ... } 6console.log(openapi.v31); // { $schema, id, properties, definitions, ... }
Or you can import the specific version(s) that you need:
1const { openapiV1, openapiV2, openapiV3, openapiV31 } = require("@apidevtools/openapi-schemas"); 2 3console.log(openapiV1); // { $schema, id, properties, definitions, ... } 4console.log(openapiV2); // { $schema, id, properties, definitions, ... } 5console.log(openapiV3); // { $schema, id, properties, definitions, ... } 6console.log(openapiV31); // { $schema, id, properties, definitions, ... }
You can use a JSON Schema validator such as Z-Schema or AJV to validate OpenAPI definitions against the specification.
1const { openapiV31 } = require("@apidevtools/openapi-schemas"); 2const ZSchema = require("z-schema"); 3 4// Create a ZSchema validator 5let validator = new ZSchema(); 6 7// Validate an OpenAPI definition against the OpenAPI v3.0 specification 8validator.validate(openapiDefinition, openapiV31);
Contributions, enhancements, and bug-fixes are welcome! Open an issue on GitHub and submit a pull request.
To build the project locally on your computer:
Clone this repo
git clone https://github.com/APIDevTools/openapi-schemas.git
Install dependencies
npm install
Build the code
npm run build
Run the tests
npm test
OpenAPI Schemas 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 binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 1/28 approved changesets -- score normalized to 0
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
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
20 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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