diff --git a/.github/workflows/smoke.yaml b/.github/workflows/smoke.yaml index f4fc05fd40..8ec3024927 100644 --- a/.github/workflows/smoke.yaml +++ b/.github/workflows/smoke.yaml @@ -297,9 +297,9 @@ jobs: docker run --rm -v $PWD:/spec redocly/cli:latest bundle openapi.yaml --ext json docker run --rm -v $PWD:/spec redocly/cli:latest build-docs openapi.yaml # Check for broken styles (related issue: https://github.com/Redocly/redocly-cli/issues/1073) - if [[ "$(wc -l redoc-static.html)" == "294 redoc-static.html" ]]; then + if [[ "$(wc -l redoc-static.html)" == "300 redoc-static.html" ]]; then echo "Docs built correctly." else - echo "Docs built incorrectly. Received lines: $(wc -l redoc-static.html) (expected 294 lines in redoc-static.html)." + echo "Docs built incorrectly. Received lines: $(wc -l redoc-static.html) (expected 300 lines in redoc-static.html)." exit 1 fi diff --git a/__tests__/lint/assertions-severity-override/openapi.yaml b/__tests__/lint/assertions-severity-override/openapi.yaml new file mode 100644 index 0000000000..c21f2a0ee5 --- /dev/null +++ b/__tests__/lint/assertions-severity-override/openapi.yaml @@ -0,0 +1,4 @@ +openapi: 3.1.0 +info: + title: Test API + version: 1.0.0 diff --git a/__tests__/lint/assertions-severity-override/redocly.yaml b/__tests__/lint/assertions-severity-override/redocly.yaml new file mode 100644 index 0000000000..7a4dffafc4 --- /dev/null +++ b/__tests__/lint/assertions-severity-override/redocly.yaml @@ -0,0 +1,8 @@ +extends: + - ruleset.yaml + +apis: + main: + root: ./openapi.yaml + rules: + rule/test-license: warn # should not be highlighted diff --git a/__tests__/lint/assertions-severity-override/ruleset.yaml b/__tests__/lint/assertions-severity-override/ruleset.yaml new file mode 100644 index 0000000000..79ea522e25 --- /dev/null +++ b/__tests__/lint/assertions-severity-override/ruleset.yaml @@ -0,0 +1,13 @@ +rules: + rule/test-license: # the default severity (error) of this configurable rule will be overwritten in redocly.yaml + subject: + type: Info + property: license + assertions: + defined: true + rule/test-description: + subject: + type: Info + property: description + assertions: + defined: true diff --git a/__tests__/lint/assertions-severity-override/snapshot.js b/__tests__/lint/assertions-severity-override/snapshot.js new file mode 100644 index 0000000000..9641400264 --- /dev/null +++ b/__tests__/lint/assertions-severity-override/snapshot.js @@ -0,0 +1,42 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`E2E lint assertions-severity-override 1`] = ` + +validating openapi.yaml... +[1] openapi.yaml:3:3 at #/info/description + +rule/test-description failed because the Info description didn't meet the assertions: Should be defined + +1 | openapi: 3.1.0 +2 | info: +3 | title: Test API + | ^^^^^^^^^^^^^^^ +4 | version: 1.0.0 + | ^^^^^^^^^^^^^^ +5 | + +Error was generated by the rule/test-description rule. + + +[2] openapi.yaml:3:3 at #/info/license + +rule/test-license failed because the Info license didn't meet the assertions: Should be defined + +1 | openapi: 3.1.0 +2 | info: +3 | title: Test API + | ^^^^^^^^^^^^^^^ +4 | version: 1.0.0 + | ^^^^^^^^^^^^^^ +5 | + +Warning was generated by the rule/test-license rule. + + +openapi.yaml: validated in ms + +❌ Validation failed with 1 error and 1 warning. +run \`redocly lint --generate-ignore-file\` to add all problems to the ignore file. + + +`; diff --git a/__tests__/smoke/openapi.yaml b/__tests__/smoke/openapi.yaml index 4375c7695a..efcd308233 100644 --- a/__tests__/smoke/openapi.yaml +++ b/__tests__/smoke/openapi.yaml @@ -17,3 +17,5 @@ paths: application/json: schema: $ref: ./message-schema.yaml + 400: + $ref: https://raw.githubusercontent.com/Redocly/redocly-cli/refs/heads/main/resources/museum.yaml#/components/responses/BadRequest diff --git a/__tests__/smoke/run-smoke.sh b/__tests__/smoke/run-smoke.sh index 25844e7600..df047ef873 100644 --- a/__tests__/smoke/run-smoke.sh +++ b/__tests__/smoke/run-smoke.sh @@ -17,9 +17,9 @@ $2 redocly-lint $2 redocly-bundle $2 redocly-build-docs # Check for broken styles (related issue: https://github.com/Redocly/redocly-cli/issues/1073) -if [[ "$(wc -l redoc-static.html)" == "294 redoc-static.html" ]]; then +if [[ "$(wc -l redoc-static.html)" == "300 redoc-static.html" ]]; then echo "Docs built correctly." else - echo "Docs built incorrectly. Received lines: $(wc -l redoc-static.html) (expected 294 lines in redoc-static.html)." + echo "Docs built incorrectly. Received lines: $(wc -l redoc-static.html) (expected 300 lines in redoc-static.html)." exit 1 fi diff --git a/benchmark/package.json b/benchmark/package.json index 8c3105b2ac..b63907f892 100644 --- a/benchmark/package.json +++ b/benchmark/package.json @@ -35,6 +35,7 @@ "cli-1.25": "npm:@redocly/cli@1.25.15", "cli-1.26": "npm:@redocly/cli@1.26.1", "cli-1.27": "npm:@redocly/cli@1.27.2", + "cli-1.28": "npm:@redocly/cli@1.28.2", "cli-next": "file:../redocly-cli.tgz" } }