Validate OpenAPI definitions, with rich diagnostics.GitHub
With openapi-cli, you can quickly validate a multi-file OpenAPI definition. An unbundled definition is far easier to edit and to reduce duplicated type definitions. When the definition is ready, openapi-cli makes it easy to bundle it into one file for distribution.
The openapi-cli tool makes it easy to document every type only once. Instead of a monolithic OpenAPI definition, it can be split over a directory hierarchy of definitions files, tied together using file references. You document a type once, and then reference it from everywhere it is needed.
Verify the definition for correctness to the OpenAPI specification. Optionally suppress errors or extend with custom validation rules for corporate guidelines. Validate a multi-file definition without having to bundle it.
Not only is OpenAPI CLI faster, it outputs errors and warnings with expanded code frames for context. With filename, line and character number precision you can directly navigate to the error and solve the issue faster. Our API registry uses OpenAPI CLI under the hood. For continuous validation of your API definitions, try us out.
Stuck on version 2? Not a problem. Using the latest version 3? Even better. The openapi-cli tool supports advanced OpenAPI v3 declarations like the discriminator, “one of”, “any of”, “all of”, or nullable, callbacks and links. It supports remote references by file path and URL.
No server required. The openapi-cli tool is installed from npm and executes at the command line.
$ openapi login
$ openapi preview-docs
Includes a standalone Redoc community edition development server letting you preview the reference docs without having to bundle it first. For our Redocly clients, login and it includes a development server of our advanced reference docs product.
The files for the definition, as well as the Redocly configuration file, can be managed with a source code management system like Git, for advanced project management.
$ npx create-openapi-repo
We have a companion repository template which installs a sample multi-file API definition and our OpenAPI CLI tool. If you are new to the multi-file format, try it out. It can also convert your existing API definition into a multi-file definition. Note that create-openapi-repo is only for the latest version of OpenAPI.