spectral icon indicating copy to clipboard operation
spectral copied to clipboard

severity level returned by custom function is not taking into account

Open fmazeiras opened this issue 6 months ago • 0 comments

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.

fmazeiras avatar Aug 14 '24 08:08 fmazeiras