
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
openapi-schema-validator
Advanced tools
A validator for OpenAPI documents.
v3v2 (formerly known as Swagger V2)definitions property of the
provided openapi document.Huge thank you to the gnostic project for building up a 3.0.0 JSON schema.
var OpenAPISchemaValidator = require('openapi-schema-validator').default;
var validator = new OpenAPISchemaValidator({
version: 2,
// optional
extensions: {
/* place any properties here to extend the schema. */
}
});
console.log(validator.validate(apiDoc));
version number openapi document schema version to use (2 or 3).
openapi-2.0.0 (default)openapi-3.0.0see here for example results.
apiDoc object is any api document you wish to validate.The MIT License (MIT)
Copyright (c) 2018 Kogo Software LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Swagger Parser is a powerful tool for validating, parsing, and dereferencing Swagger and OpenAPI definitions. It offers more comprehensive functionality compared to openapi-schema-validator, including resolving $ref pointers and bundling multiple files into a single schema.
AJV (Another JSON Schema Validator) is a highly efficient JSON schema validator that can be used to validate OpenAPI schemas as well. While it is not specifically designed for OpenAPI, it is highly performant and supports JSON Schema draft-07, which is used by OpenAPI 3.0.
OpenAPI Backend is a framework for building and validating APIs based on OpenAPI definitions. It provides more than just schema validation; it also includes request validation, response validation, and routing based on OpenAPI definitions.
FAQs
A validator for OpenAPI documents.
The npm package openapi-schema-validator receives a total of 313,296 weekly downloads. As such, openapi-schema-validator popularity was classified as popular.
We found that openapi-schema-validator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.