SchwarzIT / spectral-intellij-plugin

IntelliJ plugin for continuous OpenAPI linting using the Spectral OpenAPI linter
Apache License 2.0
19 stars 6 forks source link
intellij intellij-plugin linter openapi plugin

Spectral Linter Plugin for JetBrains

Build Version Downloads

This plugin is a wrapper for the tool Spectral, a linter for OpenApi schemas.

Installation

Since version 2 of this plugin it is required to have the spectral CLI installed on your system. If you don't have it installed yet make sure to follow this guide: Installing Spectral

Note: The CLI needs to be in your path and executable from the command line.

Features

Automatic linting

Automatic linting of your OpenApi specifications and highlighting in your editor

Configurable Ruleset

Specify your own ruleset in the plugins settings, under Preferences -> Tools -> Spectral -> Ruleset.

There you can specify 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.

Examples:

Configurable Included path patterns

Select the files that will be linted. By default, every file called "openapi.json", "openapi.yml" or "openapi.yaml" within the Project root will be matched for linting by the plugin when it's opened.

You can adjust this in the settings under Preferences -> Tools -> Spectral -> Included path patterns. All paths are relative to the project's root directory unless absolute.

Examples:

Note: Each file must also be recognised by the IDE as a JSON or YAML file - that is with a suitable File Type association. If it is detected as a plain text (or any other type) it will be ignored.


Plugin based on the IntelliJ Platform Plugin Template.