The fastest way to see something useful is to print something out to the console.
This will print a summary of your linting results. The lint
command will use the
Recommended RuleSet.
Just want to try things out?
If you don’t have an OpenAPI spec and you want to see something, you can run it against one of the test specifications. A good one to try is the petstorev3.json specification.
Linting multiple files
From v0.5.0+
The lint
command accepts multiple OpenAPI files as inputs, either as a glob pattern, or as a list of files.
Or as a glob pattern
Available Flags
lint
supports the following flags
Short | Full | Input | Description |
---|---|---|---|
-d | –details | bool |
Show full details of the linting report |
-c | –category | string |
Used with -d , Show a single category of results |
-e | –errors | bool |
Used with -d , Show only reported errors |
-x | –silent | bool |
Show no output, except for the linting result |
-s | –snippets | bool |
Used with -d , shows highlighted code in console |
-n | –fail-severity | string |
Set the level at which an error return code is thrown (defaults to error ) |
-q | –no-style | bool |
Disable color and style console output (useful for CI/CD) |
-h | –help | bool |
Show help screen and all flag details |
Global Flags
lint
supports the following global flags
Short | Full | Input | Description |
---|---|---|---|
-r | –ruleset | string |
Use an existing ruleset file for linting |
-t | –time | bool |
Show how long it took to lint the spec in (ms) |
-p | –base | string |
Base URL or Base working directory to use for relative references |
-u | –remote | string |
Load remote references automatically if possible (default is true) |
-k | –skip-check | string |
Skip checking for a valid OpenAPI document, useful for linting fragments or non-OpenAPI documents |
Full flags begin with a double hyphen.
Examples
Want something easy to copy and paste?