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
Describe the bug
I am using Spectral to enforce the URL Style Guidelines against my OpenAPI spec. Overall, I want to enforce the (resource-names-plural)[https://apistylebook.stoplight.io/docs/url-guidelines/#resource-names-plural] rule, but I do have a few exceptions that I'm trying to use overrides for.
One example is the /v1/user/me endpoint. This is simple, as I added the following to my Spectral configuration and get the desired result:
But I have another endpoint that is /v1/comments/{uuid}/context (notice the parameter with the brackets). I cannot get the override to match. I've tried:
…but it won't suppress the rule for that endpoint. The problem seems to be with the brackets. If I remove them in both the OpenAPI file and my rule (changing the rule to match **#/paths/~1v1~1comments~1uuid~1context), it matches correctly and I get the desired result.
Is there a trick to matching the brackets? My guess is that this is a pretty common flow and I'm just missing something.
Thanks!
To Reproduce
Generate an OpenAPI document with a path that includes brackets
Enable the resource-names-plural rule
Add an override to suppress the rule for the path with brackets
Run the CLI
Expected behavior
Should pass without any warnings or errors
Screenshots \
The text was updated successfully, but these errors were encountered:
Describe the bug
I am using Spectral to enforce the URL Style Guidelines against my OpenAPI spec. Overall, I want to enforce the (
resource-names-plural
)[https://apistylebook.stoplight.io/docs/url-guidelines/#resource-names-plural] rule, but I do have a few exceptions that I'm trying to use overrides for.One example is the
/v1/user/me
endpoint. This is simple, as I added the following to my Spectral configuration and get the desired result:But I have another endpoint that is
/v1/comments/{uuid}/context
(notice the parameter with the brackets). I cannot get the override to match. I've tried:…but it won't suppress the rule for that endpoint. The problem seems to be with the brackets. If I remove them in both the OpenAPI file and my rule (changing the rule to match
**#/paths/~1v1~1comments~1uuid~1context
), it matches correctly and I get the desired result.Is there a trick to matching the brackets? My guess is that this is a pretty common flow and I'm just missing something.
Thanks!
To Reproduce
resource-names-plural
ruleExpected behavior
Should pass without any warnings or errors
Screenshots
\
The text was updated successfully, but these errors were encountered: