This package has been deprecated

Author message:

This project has been renamed to @redocly/cli. Install using new package name instead.

@redocly/openapi-cli

1.0.0-beta.95 • Public • Published

OpenAPI CLI toolset

OpenAPI CLI toolbox with rich validation and bundling features.

Travis (.org) npm (scoped) NPM

OpenAPI 3 CLI toolset

Features

Currently, @redocly/openapi-cli supports these features:

  • [x] Multifile validation. No need to bundle your file before validation.
  • [x] Lightning-fast validation. Lint a 1 Mb file in less than one second.
  • [x] Built-in rules for common validations.
  • [x] Configurable severity levels for each rule.
  • [x] Human-readable error messages with codeframes and stylish format options.
  • [x] Intuitive suggestions for misspelled types or references.
  • [x] Easy to implement custom rules.
  • [x] Bundle a multifile definition into a single file.
  • [x] Decorators to modify a validated definition during bundling.
  • [x] Preview reference docs for local development.
  • [x] Support for OpenAPI 2 (fka Swagger) and OpenAPI 3.0.
  • [ ] Support for OpenAPI 3.1 (coming soon).

What makes this tool different

Unlike other OpenAPI linters, @redocly/openapi-cli defines the possible type tree of a valid OpenAPI definition and then traverses it. This approach is very similar to how linters for programming languages work and results in major performance benefits over other approaches. Extend functionality at different points in the lifecycle with preprocessors, rules, and decorators.

TLDR

npx @redocly/openapi-cli lint path-to-root-file.yaml

Read the docs

Credits

Thanks to graphql-js and eslint for inspiration of the definition traversal approach and to Swagger, Spectral, and OAS-Kit for inspiring the ruleset.

Package Sidebar

Install

npm i @redocly/openapi-cli

Weekly Downloads

44,512

Version

1.0.0-beta.95

License

MIT

Unpacked Size

279 kB

Total Files

79

Last publish

Collaborators

  • aye-one
  • oleksandr.saveliev
  • bohdan.petryshyn
  • okachynskyy
  • viacheslavoprysk
  • romanhotsiy
  • alawar
  • adamaltman
  • marshevskyy