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

severity level returned by custom function is not taking into account #2667

Open
fmazeiras opened this issue Aug 14, 2024 · 0 comments
Open

Comments

@fmazeiras
Copy link

Describe the bug
severity displayed into the output should take into account severity returned by custom function

To Reproduce

  1. using the following swagger petstore-openapi.json

  2. using the spectral rule
    formats: ["oas3","oas2"]
    functions: [serverUrl]
    rules:
    OAPI-U1-server-dns-oas3:
    description: The service server is available via a DNS name
    message: '{{description}}. {{error}}'
    severity: error
    given: "$.servers[*]"
    formats: [oas3]
    then:
    function: serverUrl
    functionOptions:
    test: OAPIU1

  3. with the following custom function
    serverUrl.js.txt

  4. Run this CLI command 'spectral lint petstore-openapi.json --format json --ruleset spectral.yaml'

  5. See error
    bug spectral

Expected behavior
severity displayed into the output should take into account severity returned by custom function

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (remove any that are not applicable):

  • Library version: 6.11.1
  • OS: Windows 11

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant