Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

openapi3-ts

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi3-ts

TS Model & utils for OpenAPI 3.x specification.

  • 4.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
decreased by-46.53%
Maintainers
1
Weekly downloads
 
Created

What is openapi3-ts?

The openapi3-ts npm package is a TypeScript library that provides types and utility functions for working with OpenAPI 3.0.x documents. It allows developers to create, manipulate, and validate OpenAPI specifications programmatically.

What are openapi3-ts's main functionalities?

Creating OpenAPI documents

This feature allows developers to create new OpenAPI documents by defining the necessary OpenAPI object structure in TypeScript. The code sample represents a basic OpenAPI document structure with the required fields.

{"openApi": "3.0.0","info": {"title": "Sample API","version": "1.0.0"},"paths": {}}

Manipulating OpenAPI documents

This feature allows developers to add or modify paths, operations, and other components within an OpenAPI document. The code sample demonstrates adding a new path with a GET operation to an existing OpenAPI document.

{"openApi": "3.0.0","info": {"title": "Sample API","version": "1.0.0"},"paths": {"/pets": {"get": {"summary": "List all pets","operationId": "listPets","tags": ["pets"],"responses": {"200": {"description": "An paged array of pets"}}}}}}

Validating OpenAPI documents

This feature provides the ability to validate OpenAPI documents against the OpenAPI 3.0.x specification. The code sample shows how to create a validator instance and validate an OpenAPI document.

const OpenAPIValidator = require('openapi3-ts').OpenAPIValidator;const openApiDoc = {openApi: '3.0.0',info: {title: 'Sample API',version: '1.0.0'},paths: {}};const validator = new OpenAPIValidator(openApiDoc);const isValid = validator.validate();

Other packages similar to openapi3-ts

Keywords

FAQs

Package last updated on 27 Aug 2024

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