{"id":14986694,"url":"https://github.com/apidevtools/openapi-schemas","last_synced_at":"2025-04-09T23:16:16.831Z","repository":{"id":52609308,"uuid":"193236806","full_name":"APIDevTools/openapi-schemas","owner":"APIDevTools","description":"JSON Schemas for every version of the OpenAPI Specification","archived":false,"fork":false,"pushed_at":"2021-05-01T15:44:33.000Z","size":286,"stargazers_count":41,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T23:15:50.449Z","etag":null,"topics":["javascript","json-schema","nodejs","openapi","openapi-specification","openapi3","rest-api","swagger","validation"],"latest_commit_sha":null,"homepage":"https://apitools.dev/openapi-schemas/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/APIDevTools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-22T13:26:54.000Z","updated_at":"2025-03-24T07:44:24.000Z","dependencies_parsed_at":"2022-09-22T14:41:18.712Z","dependency_job_id":null,"html_url":"https://github.com/APIDevTools/openapi-schemas","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APIDevTools%2Fopenapi-schemas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APIDevTools%2Fopenapi-schemas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APIDevTools%2Fopenapi-schemas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APIDevTools%2Fopenapi-schemas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/APIDevTools","download_url":"https://codeload.github.com/APIDevTools/openapi-schemas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125591,"owners_count":21051770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","json-schema","nodejs","openapi","openapi-specification","openapi3","rest-api","swagger","validation"],"created_at":"2024-09-24T14:13:22.031Z","updated_at":"2025-04-09T23:16:16.780Z","avatar_url":"https://github.com/APIDevTools.png","language":"JavaScript","readme":"# OpenAPI Specification Schemas\n\n[![Cross-Platform Compatibility](https://apitools.dev/img/badges/os-badges.svg)](https://github.com/APIDevTools/openapi-schemas/actions)\n[![Build Status](https://github.com/APIDevTools/openapi-schemas/workflows/CI-CD/badge.svg?branch=master)](https://github.com/APIDevTools/openapi-schemas/actions)\n\n[![Coverage Status](https://coveralls.io/repos/github/APIDevTools/openapi-schemas/badge.svg?branch=master)](https://coveralls.io/github/APIDevTools/openapi-schemas)\n[![Dependencies](https://david-dm.org/APIDevTools/openapi-schemas.svg)](https://david-dm.org/APIDevTools/openapi-schemas)\n\n[![npm](https://img.shields.io/npm/v/@apidevtools/openapi-schemas.svg)](https://www.npmjs.com/package/@apidevtools/openapi-schemas)\n[![License](https://img.shields.io/npm/l/@apidevtools/openapi-schemas.svg)](LICENSE)\n[![Buy us a tree](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-lightgreen)](https://plant.treeware.earth/APIDevTools/openapi-schemas)\n\n\n\nThis package contains [**the official JSON Schemas**](https://github.com/OAI/OpenAPI-Specification/tree/master/schemas) for every version of Swagger/OpenAPI Specification:\n\n| Version | Schema | Docs\n|---------|--------|-------\n| Swagger 1.2   | [v1.2 schema](https://github.com/OAI/OpenAPI-Specification/tree/master/schemas/v1.2)               | [v1.2 docs](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/1.2.md)\n| Swagger 2.0   | [v2.0 schema](https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v2.0/schema.json)   | [v2.0 docs](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md)\n| OpenAPI 3.0.x | [v3.0.x schema](https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v3.0/schema.json) | [v3.0.3 docs](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md)\n| OpenAPI 3.1.x | [v3.1.x schema](https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v3.1/schema.json) | [v3.1.0 docs](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md)\n\n\nAll schemas are kept up-to-date with the latest official definitions via an automated CI/CD job. 🤖📦\n\n\n\nInstallation\n--------------------------\nYou can install OpenAPI Schemas via [npm](https://docs.npmjs.com/about-npm/).\n\n```bash\nnpm install @apidevtools/openapi-schemas\n```\n\n\n\nUsage\n--------------------------\n\nThe default export contains all OpenAPI Specification versions:\n\n```javascript\nconst openapi = require(\"@apidevtools/openapi-schemas\");\n\nconsole.log(openapi.v1);    // { $schema, id, properties, definitions, ... }\nconsole.log(openapi.v2);    // { $schema, id, properties, definitions, ... }\nconsole.log(openapi.v3);    // { $schema, id, properties, definitions, ... }\nconsole.log(openapi.v31);    // { $schema, id, properties, definitions, ... }\n```\n\nOr you can import the specific version(s) that you need:\n\n```javascript\nconst { openapiV1, openapiV2, openapiV3, openapiV31 } = require(\"@apidevtools/openapi-schemas\");\n\nconsole.log(openapiV1);    // { $schema, id, properties, definitions, ... }\nconsole.log(openapiV2);    // { $schema, id, properties, definitions, ... }\nconsole.log(openapiV3);    // { $schema, id, properties, definitions, ... }\nconsole.log(openapiV31);    // { $schema, id, properties, definitions, ... }\n```\n\nYou can use a JSON Schema validator such as [Z-Schema](https://www.npmjs.com/package/z-schema) or [AJV](https://www.npmjs.com/package/ajv) to validate OpenAPI definitions against the specification.\n\n```javascript\nconst { openapiV31 } = require(\"@apidevtools/openapi-schemas\");\nconst ZSchema = require(\"z-schema\");\n\n// Create a ZSchema validator\nlet validator = new ZSchema();\n\n// Validate an OpenAPI definition against the OpenAPI v3.0 specification\nvalidator.validate(openapiDefinition, openapiV31);\n```\n\n\n\nContributing\n--------------------------\nContributions, enhancements, and bug-fixes are welcome!  [Open an issue](https://github.com/APIDevTools/openapi-schemas/issues) on GitHub and [submit a pull request](https://github.com/APIDevTools/openapi-schemas/pulls).\n\n#### Building\nTo build the project locally on your computer:\n\n1. __Clone this repo__\u003cbr\u003e\n`git clone https://github.com/APIDevTools/openapi-schemas.git`\n\n2. __Install dependencies__\u003cbr\u003e\n`npm install`\n\n3. __Build the code__\u003cbr\u003e\n`npm run build`\n\n4. __Run the tests__\u003cbr\u003e\n`npm test`\n\n\n\nLicense\n--------------------------\nOpenAPI Schemas is 100% free and open-source, under the [MIT license](LICENSE). Use it however you want.\n\nThis package is [Treeware](http://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/APIDevTools/openapi-schemas) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.\n\n\n\nBig Thanks To\n--------------------------\nThanks to these awesome companies for their support of Open Source developers ❤\n\n[![GitHub](https://apitools.dev/img/badges/github.svg)](https://github.com/open-source)\n[![NPM](https://apitools.dev/img/badges/npm.svg)](https://www.npmjs.com/)\n[![Coveralls](https://apitools.dev/img/badges/coveralls.svg)](https://coveralls.io)\n[![Travis CI](https://apitools.dev/img/badges/travis-ci.svg)](https://travis-ci.com)\n[![SauceLabs](https://apitools.dev/img/badges/sauce-labs.svg)](https://saucelabs.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapidevtools%2Fopenapi-schemas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapidevtools%2Fopenapi-schemas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapidevtools%2Fopenapi-schemas/lists"}