-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
[WIP] fix(rulesets): do not mix up irrelevant rules within rulesets #677
Conversation
Ah!!! The build points out to some failures. Time to dig in 😉 |
The long term plan was to remove spectral oas2 and oas3 rulesets and keep oas only, which as you noticed contains all rules. I'll write a brief recap of the story behind the change in the morning. |
Ah! This explains a lot of things, then. To be honest, I was starting to feel a little bit uneasy to see so little tests failing as I was working through the code with a machete. Considering this, I'm going to do three things:
👍 |
@nulltoken Making OAS2 and OAS3 rulesets private was not really an option for us at the time formats feature was released, as it was a minor release, hence we couldn't afford introducing any breaking changes. I hope it makes sense. Let me know if you have any further questions, happy to answer them.
Yeah, that would be awesome!
Ditto, if you are eager to look into this, that'd be great! |
I think we could probably close this down and focus on #561 which will delete a lot of the old confusing things. Now that we have formats and oas2- and oas3- on everything we can make one mega-ruleset. |
Closing in favor of #561 |
Checklist
Does this PR introduce a breaking change?
The doco states
Spectral comes with two built in rulesets - one for OpenAPI v2 (spectral:oas2), and one for OpenAPI v3 (spectral:oas3).
However, it looks like those built-in rulesets do not only contain relevant rules.
spectral:oas2
contains rules that only target an oas3 documentspectral:oas3
contains rules that only target an oas2 documentWhereas
spectral:oas
extends bothspectral:oas2
andspectral:oas3
, surprisingly, the code shows thatspectral:oas2
also extendsspectral:oas
spectral:oas3
also extendsspectral:oas
This proposed change (tries and) fixes this so that
spectral:oas2
contains rules that only target an oas2 document (or support both oas2 and oas3 documents)spectral:oas3
contains rules that only target an oas3 document (or support both oas2 and oas3 documents)spectral:oas
which contains the union ofspectral:oas2
andspectral:oas3
oas -> oas2 -> oas
/oas -> oas3 -> oas
extends and if my spike would put under the light meaningful failures of some tests.Screenshots
This test demonstrates the initial finding. Once the patch is applied, it doesn't fail any more.