-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add the possibility to skip configurable rules (#1809)
- Loading branch information
Showing
7 changed files
with
107 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@redocly/openapi-core": patch | ||
"@redocly/cli": patch | ||
--- | ||
|
||
Added the possibility to skip configurable rules using the `--skip-rule` option. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,3 @@ output/ | |
*.tgz | ||
redoc-static.html | ||
packages/cli/README.md | ||
/redocly.yaml | ||
/.redocly.yaml | ||
/redocly.yml | ||
/.redocly.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Sample API | ||
version: 1.0.0 | ||
description: It should skip built-in and configurable rules. | ||
paths: | ||
/users: | ||
get: | ||
summary: Retrieve a list of users | ||
operationId: camelCase | ||
responses: | ||
'200': | ||
description: A list of users | ||
content: | ||
application/json: | ||
schema: | ||
type: object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apis: | ||
main: | ||
root: ./openapi.yaml | ||
rules: | ||
rule/operationId-casing: | ||
subject: | ||
type: Operation | ||
property: operationId | ||
assertions: | ||
casing: PascalCase | ||
operation-4xx-response: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`E2E lint skip-rules 1`] = ` | ||
validating /openapi.yaml... | ||
[1] openapi.yaml:10:20 at #/paths/~1users/get/operationId | ||
rule/operationId-casing failed because the Operation operationId didn't meet the assertions: "camelCase" should use PascalCase | ||
8 | get: | ||
9 | summary: Retrieve a list of users | ||
10 | operationId: camelCase | ||
| ^^^^^^^^^ | ||
11 | responses: | ||
12 | '200': | ||
Error was generated by the rule/operationId-casing rule. | ||
[2] openapi.yaml:11:7 at #/paths/~1users/get/responses | ||
Operation must have at least one \`4XX\` response. | ||
9 | summary: Retrieve a list of users | ||
10 | operationId: camelCase | ||
11 | responses: | ||
| ^^^^^^^^^ | ||
12 | '200': | ||
13 | description: A list of users | ||
Error was generated by the operation-4xx-response rule. | ||
/openapi.yaml: validated in <test>ms | ||
❌ Validation failed with 2 errors. | ||
run \`redocly lint --generate-ignore-file\` to add all problems to the ignore file. | ||
`; | ||
|
||
exports[`E2E lint skip-rules 2`] = ` | ||
validating /openapi.yaml... | ||
/openapi.yaml: validated in <test>ms | ||
Woohoo! Your API description is valid. 🎉 | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f55be3f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage report
Test suite run success
812 tests passing in 121 suites.
Report generated by 🧪jest coverage report action from f55be3f