# oas-validator

> Parser/validator for OpenAPI 3.x definitions

Latest version **5.0.8** (published 2021-07-07) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install oas-validator
pnpm add oas-validator
yarn add oas-validator
bun add oas-validator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.8 |
| Published | 2021-07-07 |
| First published | 2018-06-27 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 65.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 747 |
| Author | Mike Ralphson |
| Maintainers | mermade |
| Keywords | openapi, oas, parser, validator, validation |

## Links

- npm: https://www.npmjs.com/package/oas-validator
- Repository: https://github.com/Mermade/oas-kit
- Homepage: https://github.com/Mermade/oas-kit#readme
- Issues: https://github.com/mermade/oas-kit/issues
- Funding: https://github.com/Mermade/oas-kit?sponsor=1
- npm.io page: https://npm.io/package/oas-validator

## Dependencies (8)

- [yaml](https://npm.io/package/yaml.md) ^1.10.0
- [should](https://npm.io/package/should.md) ^13.2.1
- [reftools](https://npm.io/package/reftools.md) ^1.1.9
- [oas-linter](https://npm.io/package/oas-linter.md) ^3.2.2
- [oas-resolver](https://npm.io/package/oas-resolver.md) ^2.5.6
- [call-me-maybe](https://npm.io/package/call-me-maybe.md) ^1.0.1
- [oas-kit-common](https://npm.io/package/oas-kit-common.md) ^1.0.8
- [oas-schema-walker](https://npm.io/package/oas-schema-walker.md) ^1.1.5

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 5.0.8 (latest) — 2021-07-07
- 5.0.7 — 2021-06-17
- 5.0.6 — 2021-05-31
- 5.0.5 — 2021-01-24
- 5.0.4 — 2020-11-20
- 5.0.3 — 2020-10-14
- 5.0.2 — 2020-09-22
- 5.0.1 — 2020-09-18
- 5.0.0 — 2020-09-02
- 4.0.8 — 2020-08-12
- 4.0.7 — 2020-07-31
- 4.0.6 — 2020-07-13
- 4.0.5 — 2020-07-08
- 4.0.4 — 2020-07-08
- 4.0.3 — 2020-04-13
- … 36 more at https://npm.io/package/oas-validator/versions

## README

# oas-validator

Usage:

```javascript
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](/docs/options.md) of the `options` object.

---
_Source: https://npm.io/package/oas-validator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
