JSPM

  • Created
  • Published
  • Downloads 4058694
  • Score
    100M100P100Q209360F
  • License MIT

TS Model & utils for OpenAPI 3.x specification.

Package Exports

  • openapi3-ts
  • openapi3-ts/dist/cjs/index.js
  • openapi3-ts/dist/mjs/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (openapi3-ts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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.

To use version 3.1

From Typescript you can consume it from the library:

import { OpenAPIObject, OpenApiBuilder } from "openapi3-ts"; 

Or direclty from the sources:

import { OpenAPIObject, OpenApiBuilder } from "openapi3-ts/src"; 

From a JavaScript application you can import:

import * as openapi31 from 'openapi3-ts';
 

To use version 3.0 import

From Typescript you can consume it from the library:

import { OpenAPIObject } from "openapi3-ts/model/openapi30"; 
import { OpenApiBuilder } from "openapi3-ts/dsl/openapi-builder30";

Or directly from the sources:

import { OpenAPIObject } from "openapi3-ts/src/model/openapi30"; 
import { OpenApiBuilder } from "openapi3-ts/src/dsl/openapi-builder30"; 

From a JavaScript application you can import:

import * as model from 'openapi3-ts/dist/cjs/model/openapi30';
import * as dsl from 'openapi3-ts/dist/cjs/dsl/openapi-builder30'; 

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

Versions and Changelog

See changelog.

References

License

Licensed under the MIT License.

Credits

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

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