Socket
Socket
Sign inDemoInstall

openapi31-ts

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi31-ts

TS Model & utils for OpenAPI 3.1.x specification.


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

OpenApi31-TS

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

For OpenAPI 3.0.x contracts see instead: openapi3-ts.

Coverage Status Known Vulnerabilities npm version

NPM

How to use

This library provides an internal DSL and Typescript interfaces to help to build and produce OpenAPI Specfications and to format them as JSON and YAML.

See the test in the *.spec.ts files to see how to use it.

Main differences between OpenAPI 3.0 and OpenAPI 3.1

For working with OpenAPI v. 3.1.0 use this library, for OpenAPI 3.0.0 use this other twin one: openapi3-ts.

Main differences in implementation are:

  1. Semantic version is dropped.
  2. Different JSON Schema rules applies (this library is not providing support for JSON Schema validation).
  3. Derived from the JSON Schema version change:
    • exclusiveMaximum was a boolean on OpenAPI 3.0, now is a number in OpenAPI 3.1.
    • exclusiveMinimum was a boolean on OpenAPI 3.0, now is a number in OpenAPI 3.1.
  4. Added support for Webhooks on OpenAPI 3.1.0
  5. Single example is deprecated in favour of examples.
  6. Type can now be an array.
  7. Type can be null with: nullable: true.
  8. Paths are optional.

Read for a more detailed comparison.

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 openapi31-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.

Keywords

FAQs

Package last updated on 02 Jan 2023

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