Skip to content

Commit 7de1e08

Browse files
docs(respect): add notes about severity configuration (#2025)
1 parent aaf6eba commit 7de1e08

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

docs/commands/respect.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,38 @@ npx @redocly/cli@latest respect <your-test-file | multiple files | files bash qu
8383
You can also pass the server overrides as an environment variable, as in the following example:
8484
`REDOCLY_CLI_RESPECT_SERVER="test=https://test.com"`.
8585

86+
---
87+
88+
- --severity
89+
- string
90+
- Severity of the check.
91+
Customize the severity level of validation checks for status codes, schemas, and content types. Setting the severity level is useful when:
92+
93+
- You're actively developing your API and want to temporarily relax validation.
94+
- You're testing new API behavior that doesn't match the current schema.
95+
- You've encountered known issues that shouldn't block test execution.
96+
- You want to treat certain validation failures as warnings instead of errors.
97+
98+
The following checks can be configured:
99+
100+
- `STATUS_CODE_CHECK`: Verifies if the status code returned with API responses matches the statuses described in the provided OpenAPI description.
101+
- `SCHEMA_CHECK`: Verifies if the response body schema matches what is defined in the provided OpenAPI description.
102+
- `SUCCESS_CRITERIA_CHECK`: Verifies if the success criteria defined in the provided Arazzo description has been met.
103+
- `CONTENT_TYPE_CHECK`: Verifies if the `Content-Type` matches what is defined in the provided OpenAPI description.
104+
105+
The following severity values are available:
106+
107+
- `error`: Validation failures cause the workflow to fail.
108+
- `warn`: Validation failures appear as warnings but don't fail the workflow.
109+
- `off`: Validation checks still run, but their results are ignored.
110+
111+
{% admonition type="info" %}
112+
Setting the severity of a check to `off` does not prevent the check from executing - it only prevents the check's results from affecting the workflow outcome.
113+
{% /admonition %}
114+
115+
For example, the following command sets status code errors to the warning severity level:
116+
`npx @redocly/cli respect test-file.yaml --severity='{"STATUS_CODE_CHECK":"warn"}'`.
117+
86118
{% /table %}
87119

88120
## Examples

0 commit comments

Comments
 (0)