You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a Spectral user, I can use a command line option so that the locations in Spectral's error/warning/information diagnostics use the same notation/syntax as the overrides/files notation in a Spectral ruleset.
Is your feature request related to a problem?
It is tedious and error prone to manually specify the files locations in ruleset overrides.
The diagnostics emitted by Spectral use one format that differs from that used in a ruleset.
108:17 warning owasp:api4:2023-rate-limit-responses-429 Operation is missing rate limiting response in responses[429]. paths./special-events/{eventId}.get.responses
If one wanted to add an override for a specific instance (not just disable the entire rule), one must "map" the path notation paths./special-events/{eventId}.get.responses to
Add a command line option so that the Spectral output uses the notation required for the ruleset overrides
Such as
108:17 warning owasp:api4:2023-rate-limit-responses-429 Operation is missing rate limiting response in responses[429]. test/data/openapi.yaml#/paths/~1special-events~1%7BeventId%7D/get/responses
Additional context
Note that the new location should use the relative file location, not the absolute file location that Spectral emits when processing a file, since ruleset files normally use relative files file paths (i.e. relative to the current directory when running the spectral CLI)
The text was updated successfully, but these errors were encountered:
Another option is to add a json-pointer or similar property to each item in the output when using --format json.
I don't know which other output formats are extensible - I don't what most of the output formats
I tried to work on a PR to address this in packages/formatters/src/json.ts but when I clone the repo, yarn && yarn build yielded errors and the CONTRIBUTING guide does not make it clear how to add a dependency (the formatters uses package.json -- so how/where do I add a dependency to the json-pointer package?
User story.
As a Spectral user, I can use a command line option so that the locations in Spectral's error/warning/information diagnostics use the same notation/syntax as the
overrides/files
notation in a Spectral ruleset.Is your feature request related to a problem?
It is tedious and error prone to manually specify the
files
locations in ruleset overrides.The diagnostics emitted by Spectral use one format that differs from that used in a ruleset.
I.e. for the Redocly Museum sample OpenAPI
and the
oas
and Spectral OWASP ruleset, Spectral emits many diagnostics, such asIf one wanted to add an override for a specific instance (not just disable the entire rule), one must "map" the path notation
paths./special-events/{eventId}.get.responses
toDescribe the solution you'd like
Add a command line option so that the Spectral output uses the notation required for the ruleset overrides
Such as
Additional context
Note that the new location should use the relative file location, not the absolute file location that Spectral emits when processing a file, since ruleset files normally use relative
files
file paths (i.e. relative to the current directory when running thespectral
CLI)The text was updated successfully, but these errors were encountered: