@readme/openapi-schemas
This package contains the official JSON Schemas for every version of Swagger/OpenAPI Specification:
Installation
You can install OpenAPI Schemas via npm.
npm install @readme/openapi-schemas
Usage
The library contains all OpenAPI Specification versions:
import { openapi } from '@readme/openapi-schemas';
console.log(openapi.v1);
console.log(openapi.v2);
console.log(openapi.v3);
console.log(openapi.v31);
You can use a JSON Schema validator such as Z-Schema or AJV to validate OpenAPI definitions against the specification.
import { openapi } from '@readme/openapi-schemas';
import ZSchema from 'z-schema';
let validator = new ZSchema();
validator.validate(openapiDefinition, openapi.v31);