SchwarzIT/spectral-intellij-plugin

Restrict linting to only OpenAPI specification files

Opened this issue · 0 comments

ntsim commented

Currently, the IDE inspections are triggered indiscriminately on any YAML/JSON files matching the configured file pattern. Unfortunately, this leads to inspections on files that are not OpenAPI specifications. This makes it really awkward when working on different projects where the pattern may not be the same and it would be more convenient to use a generic file pattern like **.yaml.

It would be good if inspections could only trigger if the plugin detects that the current file is a valid OpenAPI specification e.g. if there is an openapi property, or some other heuristics. This way, we could use a more generic file pattern without getting inspection warnings in files that aren't OpenAPI specifications.