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

oas-normalize

Package Overview
Dependencies
Maintainers
8
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oas-normalize

Swagger 2 or OAS 3? YAML or JSON? URL, path, string or object? Who cares! It just works.

  • 2.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
140K
increased by0.78%
Maintainers
8
Weekly downloads
 
Created

What is oas-normalize?

The oas-normalize npm package is designed to help developers work with OpenAPI Specification (OAS) documents. It provides functionalities to normalize, validate, and convert OAS documents, making it easier to handle different versions and formats of API specifications.

What are oas-normalize's main functionalities?

Normalization

This feature allows you to normalize an OpenAPI Specification document. The code sample demonstrates how to create an instance of OASNormalize with a path to an OAS file and validate it.

const OASNormalize = require('oas-normalize');
const oas = new OASNormalize('path/to/oas/file');
oas.validate().then(() => {
  console.log('OAS is valid');
}).catch(err => {
  console.error('OAS is invalid', err);
});

Conversion

This feature allows you to convert an OAS document to a different version or format. The code sample shows how to convert an OAS document and log the converted document.

const OASNormalize = require('oas-normalize');
const oas = new OASNormalize('path/to/oas/file');
oas.convert().then(convertedOAS => {
  console.log('Converted OAS:', convertedOAS);
}).catch(err => {
  console.error('Conversion failed', err);
});

Dereferencing

This feature allows you to dereference an OAS document, resolving all $ref pointers. The code sample demonstrates how to dereference an OAS document and log the dereferenced document.

const OASNormalize = require('oas-normalize');
const oas = new OASNormalize('path/to/oas/file');
oas.dereference().then(dereferencedOAS => {
  console.log('Dereferenced OAS:', dereferencedOAS);
}).catch(err => {
  console.error('Dereferencing failed', err);
});

Other packages similar to oas-normalize

FAQs

Package last updated on 11 Sep 2020

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