-
-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spectral no longer respecting rule overrides #2505
Comments
Hey! overrides:
- files:
- "reference/Demo.yaml#/paths/~1v2.1~1users~1%7BuserId%7D"
- "reference/Demo.yaml#/paths/~1user"
rules:
resource-names-plural: "off"
- files:
- "reference/Demo.yaml#/paths/~1v2.1~1users~1%7BuserId%7D"
rules:
path-casing: "warn" LMK if you have any questions. |
Thanks, @P0lip! I can confirm that encoding the |
Good point re the docs - will do. To give you some extra context behind that change - that's been a bug for a few years in a library that's used across our entire ecosystem. If you want to get the right pointer, you can run Node.js REPL
and then run require('@stoplight/json').pathToPointer(['abc', 'def', '{}']) # this will output you the valid pointer to use in the URI Alternatively, go to https://npm.runkit.com/@stoplight/json and run it there |
Docs got updated in 69403c1 |
Describe the bug
Running Spectral outputs linter warnings/errors for paths that have rules turned off via the
overrides
in my.spectral.yaml
. The issues seems to have coincided with the update of thespectral-core
dependency from version1.18.1
to version1.18.2
as my builds were working fine before that update was made.To Reproduce
I created a sample project that demonstrates this issue, which includes detailed steps to reproduce. Abbreviated steps below:
.spectral.yaml
.spectral lint Demo.yaml --ruleset .spectral.yaml --verbose
path-casing
andresource-names-plural
errors produced forpaths./v2.1/users/{userId}
, which is configured to disable those rules via ruleoverrides
.Expected behavior
No errors should be output.
Screenshots
Environment:
Additional context
See
README
in sample project linked above for additional details.The text was updated successfully, but these errors were encountered: