spectral
spectral copied to clipboard
severity level returned by custom function is not taking into account
Describe the bug severity displayed into the output should take into account severity returned by custom function
To Reproduce
-
using the following swagger petstore-openapi.json
-
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
-
with the following custom function serverUrl.js.txt
-
Run this CLI command 'spectral lint petstore-openapi.json --format json --ruleset spectral.yaml'
-
See error
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.