The inso lint spec
command lints and validates your OpenAPI specification. Lint results will be printed to the console, and Inso CLI will exit with an exit code. Inso CLI will exit with a non-zero exit code if linting fails.
inso lint spec [identifier]
Lint the given specification, the user will be prompted to select a specification if one is not passed as an option.
identifier
can be a specification name or id.
At the moment Inso CLI uses Spectral’s default oas
Ruleset Definition. For more information refer to the OpenAPI ruleset reference documentation.
For custom linting, refer to the Custom Linting document.
Option | Alias | Description |
---|---|---|
--output <path> |
-o | Save the specification to a file in the working directory. |
--workingDir <path> |
Specify a working directory. | |
--src <path> |
Specify the V4 export file or the Insomnia app data directory. You can use this option to set a Git data directory. If not specified, inso-cli looks for an .insomnia folder in the working directory by default. |
The following commands work when running in the example git-repo directory.
When you don’t specify any arguments, you’ll be prompted with:
inso lint spec
Scope linting by the specification name or ID:
inso lint spec spc_46c5a4
inso lint spec "Sample Specification"