-
-
Notifications
You must be signed in to change notification settings - Fork 248
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 lint
when using NPM-provided rulesets does not resolve rulesets
#2019
Comments
Could it be this requires the migration through the |
@jamietanna I am experiencing the same behaviour, created NPM package - https://www.npmjs.com/package/api-spectral as per the documentation - https://meta.stoplight.io/docs/spectral/ZG9jOjI1MTky-sharing-and-distributing-rulesets#NPM; however get the same error as you've mentioned above
|
Hey there! |
Is there a workaround? Perhaps a url to |
Hey @kernwig |
n/m: I had "spectral:oas3". Removing the |
Amazing, thanks Jakub! Is there a rough idea of when this may land on NPM? |
🎉 This issue has been resolved in version @stoplight/spectral-ruleset-migrator-v1.7.2 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
Nice, this now works with: "dependencies": {
"@govuk-data-standards/spectral-ruleset-govuk-public": "^0.1.0",
"@stoplight/spectral-cli": "^6.1.1",
"@stoplight/spectral-ruleset-migrator": "1.7.2"
} And extends:
- '@govuk-data-standards/spectral-ruleset-govuk-public'
formats:
- "oas3.1" Thank you! 🙌 Do we know when the next |
As we now have a Spectral ruleset published to NPM, we should start using it in this project to make sure that we're continually using it, rather than using the out-of-the-box Spectral OpenAPI rules. This requires that we pin the package using our `package.json`, as well as using the Until the spectral-cli is upgraded (as noted in stoplightio/spectral#2019) we need to explicitly pull the `spectral-ruleset-migrator` version that includes the fix for resolving NPM dependencies correctly.
As noted in stoplightio/spectral#2019, we cannot currently use rulesets from NPM, and need to update to the latest version of `spectral-ruleset-migrator` to pick it up.
As we now have a Spectral ruleset published to NPM, we should start using it in this project to make sure that we're continually using it, rather than using the out-of-the-box Spectral OpenAPI rules. This requires that we pin the ruleset using our `package.json`. We also need to amend our OpenAPI's `version` to match the rules required by the ruleset. Until the spectral-cli is upgraded (as noted in stoplightio/spectral#2019) we need to explicitly pull the `spectral-ruleset-migrator` version that includes the fix for resolving NPM dependencies correctly.
Describe the bug
When running
spectral lint
, vianpx
, I cannot provide an NPM-based dependency forA clear and concise description of what the bug is.
To Reproduce
Given the following
.spectral.yaml
:And the following
openapi.yml
:Then running:
Expected behavior
The rules from https://www.npmjs.com/package/spectral-aws-apigateway-ruleset are downloaded and executed
Actual Behaviour
Screenshots
N/A
Environment (remove any that are not applicable):
Additional context
N/A
The text was updated successfully, but these errors were encountered: