Spectral quick fix

The extension that focuses on establishing a ruleset file where you can find the compromised rule and fix it.

Table of contents

  1. Settings
  2. Usage

When using Spectral for linting OpenAPI contracts, we encountered that it doesn’t suggest any quick fix for the linted error. So that is how this extension started.

Since this extension is based on Spectral, the Quick fix only works for OpenAPI contracts.

Settings

This extension does not need any settings. Just download it and start enjoying it 😎

Usage

To use it, open an API contract on VS Code, and if it has errors or warnings, your code will have underlined text. This happens because Spectral found issues on your contract that break the API guidelines.

To correct the warnings/errors, put the cursor above the highlighted text, and you will see a tooltip with all the possible corrections that can be done - you can add, modify, or delete code.

If you click on one of the options, you quickly fix the code. Nice and easy.

gif