# @readme/openapi-schemas

> JSON Schemas for every version of the OpenAPI Specification

Latest version **4.0.0** (published 2026-07-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @readme/openapi-schemas
pnpm add @readme/openapi-schemas
yarn add @readme/openapi-schemas
bun add @readme/openapi-schemas
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2026-07-07 |
| First published | 2024-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 1 |
| Unpacked size | 1.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 398 |
| Author | ReadMe |
| Maintainers | gkoberger, domharrington, mjcuva, jonursenbach, rafegoldberg, darrenyong |
| Keywords | openapi, open-api, swagger, oas, api, rest, json, specification, definition, schema |

## Links

- npm: https://www.npmjs.com/package/@readme/openapi-schemas
- Repository: https://github.com/readmeio/oas
- Homepage: https://github.com/readmeio/oas#readme
- Issues: https://github.com/readmeio/oas/issues
- npm.io page: https://npm.io/package/@readme/openapi-schemas

## Dependencies (1)

- [@types/json-schema](https://npm.io/package/@types/json-schema.md) ^7.0.15

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 4.0.0 (latest) — 2026-07-07
- 3.1.0 — 2024-05-22
- 3.0.1 — 2024-05-13

## README

# @readme/openapi-schemas

[![Build](https://github.com/readmeio/oas/workflows/CI/badge.svg)](https://github.com/readmeio/openapi-schemas/) [![](https://img.shields.io/npm/v/@readme/openapi-schemas)](https://npm.im/@readme/openapi-schemas)

[![](https://raw.githubusercontent.com/readmeio/.github/main/oss-header.png)](https://readme.io)

This package contains [**the official JSON Schemas**](https://github.com/OAI/spec.openapis.org/tree/main/oas) for every version of Swagger/OpenAPI Specification:

<!-- prettier-ignore-start -->
| Version | Schema | Docs |
| :--- | :--- | :--- |
| Swagger 1.2 | [v1.2 schema](https://github.com/OAI/OpenAPI-Specification/tree/main/_archive_/schemas/v1.2) | [v1.2 docs](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/1.2.md) |
| Swagger 2.0 | [v2.0 schema](https://github.com/OAI/spec.openapis.org/tree/main/oas/2.0/schema) | [v2.0 docs](https://spec.openapis.org/oas/v2.0.html) |
| OpenAPI 3.0.x | [v3.0.x schema](https://github.com/OAI/spec.openapis.org/tree/main/oas/3.0/schema) | [v3.0.x docs](https://spec.openapis.org/oas/v3.0.4.html) |
| OpenAPI 3.1.x | [v3.1.x schema](https://github.com/OAI/spec.openapis.org/tree/main/oas/3.1/schema) | [v3.1.x docs](https://spec.openapis.org/oas/v3.1.2.html) |
| OpenAPI 3.2.x | [v3.2.x schema](https://github.com/OAI/spec.openapis.org/tree/main/oas/3.2/schema) | [v3.2.x docs](https://spec.openapis.org/oas/v3.2.0.html) |
<!-- prettier-ignore-end -->

## Installation

You can install OpenAPI Schemas via [npm](https://docs.npmjs.com/about-npm/).

```bash
npm install @readme/openapi-schemas
```

## Usage

The library contains all OpenAPI Specification versions:

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

You can use a JSON Schema validator such as [Z-Schema](https://npm.im/z-schema) or [AJV](https://npm.im/ajv) to validate OpenAPI definitions against the specification.

```js
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);
```

---
_Source: https://npm.io/package/@readme/openapi-schemas · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
