metadevpro/openapi3-ts

TS Model & utils for creating and exposing OpenAPI 3.x contracts.

TypeScript

540

332 commits

updated Oct 12, 2026

See the code

README

OpenApi3-TS

TypeScript library to help building OpenAPI 3.x compliant API contracts.

Coverage Status Known Vulnerabilities npm version

NPM

Version 4

Breaking change notice:

Version 4.0 Adds explicit support for OAS 3.0 and OAS 3.1 as separate implementations.

OAS 3.2 is available as a third parallel implementation (oas32). The JSON Schema dialect is unchanged between 3.1 and 3.2 (Draft 2020-12); 3.2 adds document-structure fields such as streaming itemSchema/itemEncoding/prefixEncoding on the Media Type Object, the reusable mediaTypes component bucket, the query HTTP method and additionalOperations, Tag hierarchies, the XML nodeType, and the OAuth device authorization flow.

To use version 3.2 import

import { oas32 } from 'openapi3-ts';

Or directly import from subpath:

import { OpenAPIObject, OpenApiBuilder } from 'openapi3-ts/oas32';

To use version 3.1 import

import { oas31 } from 'openapi3-ts';

Or directly import from subpath:

import { OpenAPIObject, OpenApiBuilder } from 'openapi3-ts/oas31';

To use version 3.0 import

import { oas30 } from 'openapi3-ts';

Or directly import from subpath:

import { OpenAPIObject, OpenApiBuilder } from 'openapi3-ts/oas30';

Includes

  • /src/model TS typed interfaces for helping building a contract.
  • /src/dsl Fluent DSL for building a contract.

Install

Install package via npm:

npm i --save openapi3-ts

Documentation, Versions, and Changelog

References

License

Licensed under the MIT License.

Credits

Contact: Pedro J. Molina | github: pjmolina | twitter: pmolinam

(c) 2017-2026. Pedro J. Molina at Metadev S.L. https://metadev.pro & contributors.

openapi
ts

metadevpro/openapi3-ts

TS Model & utils for creating and exposing OpenAPI 3.x contracts.

TypeScript

540

332 commits

updated Oct 12, 2026

See the code

README

OpenApi3-TS

TypeScript library to help building OpenAPI 3.x compliant API contracts.

Coverage Status Known Vulnerabilities npm version

NPM

Version 4

Breaking change notice:

Version 4.0 Adds explicit support for OAS 3.0 and OAS 3.1 as separate implementations.

OAS 3.2 is available as a third parallel implementation (oas32). The JSON Schema dialect is unchanged between 3.1 and 3.2 (Draft 2020-12); 3.2 adds document-structure fields such as streaming itemSchema/itemEncoding/prefixEncoding on the Media Type Object, the reusable mediaTypes component bucket, the query HTTP method and additionalOperations, Tag hierarchies, the XML nodeType, and the OAuth device authorization flow.

To use version 3.2 import

import { oas32 } from 'openapi3-ts';

Or directly import from subpath:

import { OpenAPIObject, OpenApiBuilder } from 'openapi3-ts/oas32';

To use version 3.1 import

import { oas31 } from 'openapi3-ts';

Or directly import from subpath:

import { OpenAPIObject, OpenApiBuilder } from 'openapi3-ts/oas31';

To use version 3.0 import

import { oas30 } from 'openapi3-ts';

Or directly import from subpath:

import { OpenAPIObject, OpenApiBuilder } from 'openapi3-ts/oas30';

Includes

  • /src/model TS typed interfaces for helping building a contract.
  • /src/dsl Fluent DSL for building a contract.

Install

Install package via npm:

npm i --save openapi3-ts

Documentation, Versions, and Changelog

References

License

Licensed under the MIT License.

Credits

Contact: Pedro J. Molina | github: pjmolina | twitter: pmolinam

(c) 2017-2026. Pedro J. Molina at Metadev S.L. https://metadev.pro & contributors.

openapi
ts

Project health

Overall

3.4/10

Maintained

3/10

Code review

3/10
OpenSSF Scorecard

Latest release

4.6.1 · Jul 28, 2026

Releases this year

2

Significant stargazers

Huan Li

2,359 followers · starred Sep 2021

Ivan Goncharov

889 followers · starred Mar 2017

Kevin Wang

128 followers · starred Aug 2023

Ryan Albrecht

122 followers · starred Nov 2021