Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(openapi): replace swagger-cli with redocly #165

Merged
merged 14 commits into from
Sep 18, 2023
Merged
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@actions/glob": "^0.4.0",
"@octokit/types": "^6.19.1",
"@octokit/webhooks": "^9.13.0",
"@redocly/cli": "1.0.2",
"comment-json": "^4.2.3",
"csv-reader": "^1.0.8",
"ignore": "^5.2.4"
Expand Down
7 changes: 3 additions & 4 deletions scripts/validate-openapi/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# exit when any command fails
set -e


xespona marked this conversation as resolved.
Show resolved Hide resolved
if ! command -v "jq" &> /dev/null
then
echo "Unable to find jq. Is it installed and added to your \$PATH?"
Expand Down Expand Up @@ -44,12 +45,10 @@ EOF
# Limiting the depth limits the risk of (irrelevant) `openapi.yaml` files being found in eg. `_gomodcache` or `node_modules`
IFS=$'\n' files=($(find . -maxdepth 3 -name openapi.yaml))

for f in ${files[@]}; do
npx @apidevtools/swagger-cli validate "$f"
done
npx @redocly/cli --version
xespona marked this conversation as resolved.
Show resolved Hide resolved
xespona marked this conversation as resolved.
Show resolved Hide resolved

xespona marked this conversation as resolved.
Show resolved Hide resolved
for f in ${files[@]}; do
npx @redocly/cli lint "$f"
npx @redocly/cli lint --extends=minimal "$f"
done

npx @redocly/cli bundle --dereferenced --ext json --output openapi.json $(echo ${files})
Loading
Loading