Skip to content
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

API Analysis - Stoplight package support #54

Open
juliajuju93 opened this issue Oct 3, 2024 · 1 comment
Open

API Analysis - Stoplight package support #54

juliajuju93 opened this issue Oct 3, 2024 · 1 comment
Labels
Solution provided Indicated that a fix has been proposed or implemented for the issue.

Comments

@juliajuju93
Copy link
Contributor

Description

API Analysis supports spectral as our linting engine.

The following example style guides don't work as we don't support downloading stoplight packages.

How can I get the following example rulesets to work:

extends:

  • "@stoplight/spectral-owasp-ruleset"
  • "@stoplight/spectral-url-versioning"
    rules:
    oas3-always-use-https:
    given:
    • "$.servers[].url"
      severity: error
      then:
      function: pattern
      functionOptions:
      match: "(http:\/\/localhost)|(https).
      "
      message: Servers must use the HTTPS protocol except when using localhost
      formats:
    • oas3
@juliajuju93
Copy link
Contributor Author

This is a known issue from VS Code Spectral Extension:
https://github.com/stoplightio/vscode-spectral/issues/214

As a workaround, please try updating the 'extends' property to point to remote URL or local dist JS file:

extends: - "https://unpkg.com/@stoplight/spectral-owasp-ruleset/dist/ruleset.mjs" - "https://unpkg.com/@stoplight/spectral-url-versioning/dist/ruleset.mjs"

or

extends: - "node_modules/@stoplight/spectral-owasp-ruleset/dist/ruleset.js" - "node_modules/@stoplight/spectral-url-versioning/dist/ruleset.js"

@juliajuju93 juliajuju93 added Solution provided Indicated that a fix has been proposed or implemented for the issue. and removed Bug Untriaged labels Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Solution provided Indicated that a fix has been proposed or implemented for the issue.
Projects
None yet
Development

No branches or pull requests

1 participant