Socket
Socket
Sign inDemoInstall

oas-validator

Package Overview
Dependencies
33
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    oas-validator

Parser/validator for OpenAPI 3.x definitions


Version published
Weekly downloads
1.3M
increased by1.14%
Maintainers
1
Install size
2.04 MB
Created
Weekly downloads
 

Readme

Source

oas-validator

Usage:

const validator = require('oas-validator');
const options = {};
validator.validate(openapi, options)
.then(function(options){
  // options.valid contains the result of the validation, true in this branch
})
.catch(function(err){
  console.warn(err.message);
  if (options.context) console.warn('Location',options.context.pop());
});

If a third callback argument to validate is provided, the callback will be called instead of a Promise being returned.

oas-validator is an assertion-based validator, which stops on the first error, as structural errors may otherwise cause further (spurious) errors to be reported. If the lint option is set, multiple warnings may be reported.

See here for complete documentation of the options object.

Keywords

FAQs

Last updated on 07 Jul 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc