You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I expected a nonzero exit code in any case when Spectral detects a file with unrecognized format and prints warning unrecognized-format The provided document does not match any of the registered formats [OpenAPI 2.0 (Swagger), OpenAPI 3.x, OpenAPI 3.0.x, OpenAPI 3.1.x]. However, the exit code depends on the value of the --fail-severity cmd line option.
I understand the concept of error, warn, info, hint levels and that with --fail-severity one can define for which levels a nonzero failure exit code shall be returned. I also realize that the unrecognized format scenario results in a warning. However, I expected that these levels refer solely to rule violations in the API being linted. But maybe my expectation is wrong... ;-)
Hey @max-moritz.
It's a rule internally, hence the behavior.
However, I totally agree with your reasoning, and the proposal you've made sounds more user-friendly than the existing implementation.
We would find it also useful if we can increase a level of severity of unrecognized-format to Error... This way Spectral will return non-zero error code automatically.
Describe the bug
I expected a nonzero exit code in any case when Spectral detects a file with unrecognized format and prints
warning unrecognized-format The provided document does not match any of the registered formats [OpenAPI 2.0 (Swagger), OpenAPI 3.x, OpenAPI 3.0.x, OpenAPI 3.1.x]
. However, the exit code depends on the value of the--fail-severity
cmd line option.I understand the concept of
error
,warn
,info
,hint
levels and that with--fail-severity
one can define for which levels a nonzero failure exit code shall be returned. I also realize that the unrecognized format scenario results in awarning
. However, I expected that these levels refer solely to rule violations in the API being linted. But maybe my expectation is wrong... ;-)To Reproduce
Run the following commands:
Expected behavior
Non-zero exit code in any case
Environment (remove any that are not applicable):
The text was updated successfully, but these errors were encountered: