pva
OpenAPI linter.
Install
npm install pva
Usage
$ pva <files...>
Config
Whilst pva comes with a default configuration, you can configure it by providing options using one of these methods:
- A
pva
property in yourpackage.json
- A
.pvarc
file in either JSON or YAML - A
.pvarc.json
,.pvarc.yaml
,.pvarc.yml
,.pvarc.js
or.pvarc.cjs
file - A
pva.config.js
orpva.config.cjs
file
Configuring rules
Each rule can be configured with an alert level of either error
, warning
, info
or hint
. An error
will cause pva to finish with an exit code of 1.
To configure any sort of Spectral rule, specify them within spectral.rules
of the configuration. For example, to configure the no-eval-in-markdown
, use this configuration:
{
"spectral": {
"rules": {
"no-eval-in-markdown": "error"
}
}
}
To configure an IBM validator rule, have the top level property be the spec and then the second level property be the category. For example, to configure the unused_tag
property which has a spec of shared
and a category of operations
, use this configuration:
{
"shared": {
"operations": {
"unused_tag": "warning"
}
}
}
Credits
CLI aesthetics inspired by xo.