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
#2511 has introduced a breaking change for rule override JSON Pointers. Different minor versions of spectral-core require different rule override files.
To Reproduce
create an override with a character that could be percent encoded, for example:
extends: ruleset.yamloverrides:
- files:
- openapi.yaml#/resource:custom-method/post/requestBodyrules:
my-rule: off
override works with spectral-core 1.18.2
override fails with spectral-core 1.18.3
changing the override to the following fixes 1.18.3 but breaks 1.18.2. Note the changing of ":" to "%3A"
extends: ruleset.yamloverrides:
- files:
- openapi.yaml#/resource%3Acustom-method/post/requestBodyrules:
my-rule: off
Expected behavior
This should have been released as a breaking change, requiring a bump of the spectral-cli version number. Currently we have 6.6.0 of stoplight/spectral-cli showing both of theses behaviours depending on when it was installed from NPM (and which version of spectral-core was resolved.
Environment (remove any that are not applicable):
spectral-cli 6.6.0
Node.JS 18.16.0
OS: Windows 10, Ubuntu 22.04
The text was updated successfully, but these errors were encountered:
Faced similar issue with curly brackets in path overrides. Replaced them in my rules with %7B and %7D, it fixed the issue.
At the same time Spectral VS Code plugin still operates with old version of spectral-core and doesn't recognize this escaped syntax properly. So as a workaround need to duplicate override rules in old and new format to support both CLI and VS Code.
I think at least it would help make my rule definition cleaner. This is what we experience often: VS Code extension is not updated promptly with the latest version of Spectral Core, so the way how our CI works with its up-to-date spectral-cli version does not necessarily replicate what our developers see in their VS Code interface. So, I think that more regular updates of VS Code extension after core updates would help to avoid such kinds of issues.
Describe the bug
#2511 has introduced a breaking change for rule override JSON Pointers. Different minor versions of spectral-core require different rule override files.
To Reproduce
spectral-core
1.18.2spectral-core
1.18.3:
" to "%3A
"Expected behavior
This should have been released as a breaking change, requiring a bump of the
spectral-cli
version number. Currently we have6.6.0
ofstoplight/spectral-cli
showing both of theses behaviours depending on when it was installed from NPM (and which version ofspectral-core
was resolved.Environment (remove any that are not applicable):
The text was updated successfully, but these errors were encountered: