Skip to content

Commit

Permalink
Merge branch 'main' into docs/1871-clarify-behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
HCloward authored Feb 5, 2025
2 parents 2c41b7d + da8f032 commit b0fb547
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/smoke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions __tests__/lint/assertions-severity-override/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
openapi: 3.1.0
info:
title: Test API
version: 1.0.0
8 changes: 8 additions & 0 deletions __tests__/lint/assertions-severity-override/redocly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends:
- ruleset.yaml

apis:
main:
root: ./openapi.yaml
rules:
rule/test-license: warn # should not be highlighted
13 changes: 13 additions & 0 deletions __tests__/lint/assertions-severity-override/ruleset.yaml
Original file line number Diff line number Diff line change
@@ -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
42 changes: 42 additions & 0 deletions __tests__/lint/assertions-severity-override/snapshot.js
Original file line number Diff line number Diff line change
@@ -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 <test>ms
❌ Validation failed with 1 error and 1 warning.
run \`redocly lint --generate-ignore-file\` to add all problems to the ignore file.
`;
2 changes: 2 additions & 0 deletions __tests__/smoke/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions __tests__/smoke/run-smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"cli-1.25": "npm:@redocly/[email protected]",
"cli-1.26": "npm:@redocly/[email protected]",
"cli-1.27": "npm:@redocly/[email protected]",
"cli-1.28": "npm:@redocly/[email protected]",
"cli-next": "file:../redocly-cli.tgz"
}
}
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"engines": {
"node": ">=18.17.0",
"npm": ">=10.8.2"
"npm": ">=9.5.0"
},
"engineStrict": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"engines": {
"node": ">=18.17.0",
"npm": ">=10.8.2"
"npm": ">=9.5.0"
},
"engineStrict": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "lib/index.js",
"engines": {
"node": ">=18.17.0",
"npm": ">=10.8.2"
"npm": ">=9.5.0"
},
"engineStrict": true,
"license": "MIT",
Expand Down

0 comments on commit b0fb547

Please sign in to comment.