Spectral IntelliJ Plugin
This plugin is a wrapper for the tool Spectral, a linter for OpenApi schemas. It supports all Jetbrains IDEs starting at version 2020.3.
Features
Automatic Linting
Automatic linting of your OpenApi specifications and highlighting in your editor
Customizable Ruleset
Specify your own ruleset in the plugins settings, under Preferences -> Tools -> Spectral -> Ruleset
. There you can select a file on your local machine or just paste the URL of a ruleset available on the internet e.g.: Schwarz IT API linting rules
The default ruleset comes bundled with the plugin and uses Spectrals recommended OAS ruleset.
Customizable File Matching pattern
The customization of file matching is possible under Preferences -> Tools -> Spectral -> Included files
. By default, every JSON file will be linted with default pattern **.json
by the plugin, when json file is opened. You can adjust this to **openapi*.json
(e.g. matches openapi.json), so that some other json files, such as composer. json
, package.json
, will not be included and linted automatically.
Installation
From the Jetbrains Marketplace
The latest version of the plugin is available on the Jetbrains marketplace. To install it you can follow these steps:
- Open your Jetbrains IDE
- Go to Preferences -> Plugins and search for "Spectral"
- Click install on the first result
Building from source
- Checkout this repository
- Run ./gradlew buildPlugin
- Install the generated archive under build/distributions/spectral-intellij-plugin*.zip in your IDE ( See Install plugin from disk)