Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@readme/openapi-schemas

Package Overview
Dependencies
Maintainers
11
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@readme/openapi-schemas

JSON Schemas for every version of the OpenAPI Specification

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
189K
increased by6.4%
Maintainers
11
Weekly downloads
 
Created
Source

@readme/openapi-schemas

Build

This package contains the official JSON Schemas for every version of Swagger/OpenAPI Specification:

VersionSchemaDocs
Swagger 1.2v1.2 schemav1.2 docs
Swagger 2.0v2.0 schemav2.0 docs
OpenAPI 3.0.xv3.0.x schemav3.0.3 docs
OpenAPI 3.1.xv3.1.x schemav3.1.0 docs

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); // { $schema, id, properties, definitions, ... }
console.log(openapi.v2); // { $schema, id, properties, definitions, ... }
console.log(openapi.v3); // { $schema, id, properties, definitions, ... }
console.log(openapi.v31); // { $schema, id, properties, definitions, ... }

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';

// Create a ZSchema validator
let validator = new ZSchema();

// Validate an OpenAPI definition against the OpenAPI v3.0 specification
validator.validate(openapiDefinition, openapi.v31);

Keywords

FAQs

Package last updated on 22 May 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc