-
-
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
Support --ruleset spectral:oas
from the command line & documentation
#1893
Comments
Yup, it's not possible to supply
The auto-detection has not been removed. We just no longer apply any ruleset by default.
The second point in that document explains it however now when I look at it, I agree it might be not obvious at first glance. If you have some spare time, feel free to send a PR updating the documentation with the bits that you think would help you. This would be very appreciated. |
I was thrown by this change as well. I agree with @FichteFoll, I don't like it :) Spectral v5 this works: My doc contains "openapi": "3.0.3", it was convenient that spectral would apply oas rules. This is similar to other linters like openapi-cli and speccy. I understand all that's needed is a .spectral.json file. However supporting dozens of API projects - this creates a new obstacle to getting an API developer up and running. I don't see what benefit this change is giving. |
I think you mean that auto-detection only applies to the decision between OpenAPI and AsyncAPI when
The problem isn't that it doesn't mention the change. It mentions that quite visibly, as does the CLI itself with its error message. What I'd have liked to see there was a simple instruction to get me going to how it worked before, since that was the default behavior of spectral for quite some time, I gather. |
While migrating to version 6, I had a major head-ache over the fact that I couldn't just add
--ruleset spectral:oas
to my calls because spectral interprets that as a file name instead of a "special identifer" as it does when extending. This special name is referenced all over the documentation (e.g. https://meta.stoplight.io/docs/spectral/ZG9jOjYyMDc0NQ-open-api-support), yet it took me a considerable amount of time to figure out I had to runecho "extends: spectral:oas" > .spectral.yaml
to make it work.Additionally, the auto-detection mentioned in the same page does not work either (or it wasn't removed, as I gathered from #1796 and #1797 (comment)).
Finally, the documentation at https://meta.stoplight.io/docs/spectral/ZG9jOjI1MTg1-spectral-cli is dishonest, as it states me it would "just work" when I run
spectral lint petstore.yaml
. The fact that a ruleset is required is only mentioned a whole page below.A mention of the required changes on https://meta.stoplight.io/docs/spectral/ZG9jOjg2MDIwMDM-spectral-v5-to-v6-migration-guide would also be appreciated. Coming from no configuration, I'd expect to see instructions that get me up and running the way it was before if I just followed them.
The text was updated successfully, but these errors were encountered: