Skip to content

Commit 4af0c81

Browse files
committed
feat: replace swagger-cli with redocly for OpenAPI validation
# Issue Redocly CLI is the recommended replacement for the deprecated swagger-cli package # Fix See https://redocly.com/docs/cli/guides/migrate-from-swagger-cli
1 parent 80a7bcd commit 4af0c81

File tree

5 files changed

+61
-55
lines changed

5 files changed

+61
-55
lines changed

.github/workflows/openapi-specs-check.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@ on:
44
jobs:
55
validate:
66
runs-on: ubuntu-latest
7-
container:
8-
image: ghcr.io/cloudfoundry/app-autoscaler-release-tools:main@sha256:a850ee87a32ae11003e1343714b8af06d2be377744510472601f3ff4b153968e
97
steps:
108
- name: Get Repository content
119
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
10+
- name: Install devbox
11+
uses: jetify-com/devbox-install-action@975fb35b9a6472bed4edf51e5db534d5efec2817 # v0.12.0
12+
with:
13+
enable-cache: 'true'
14+
- name: Make devbox shellenv available
15+
run: |
16+
eval "$(devbox shellenv)"
17+
printenv >> "$GITHUB_ENV"
1218
- name: Validating OpenAPI Specifications
1319
shell: bash
1420
run: |
1521
#! /usr/bin/env bash
1622
1723
set -eu -o pipefail
18-
make validate-openapi-specs
24+
make validate-openapi-specs

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ docker-image: docker-login
447447
docker push ghcr.io/cloudfoundry/app-autoscaler-release-tools:latest
448448
validate-openapi-specs: $(wildcard ./api/*.openapi.yaml)
449449
for file in $^ ; do \
450-
swagger-cli validate "$${file}" ; \
450+
redocly lint --extends=minimal --format=$(if $(GITHUB_ACTIONS),github-actions,codeframe) "$${file}" ; \
451451
done
452452

453453
.PHONY: go-get-u

devbox.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"rubocop": "latest",
2525
"rubyPackages.solargraph": "latest",
2626
"shellcheck": "0.10.0",
27-
"swagger-cli": "latest",
2827
"which": "latest",
2928
"credhub-cli": "2.9.29",
3029
"markdownlint-cli2": "latest",
@@ -39,7 +38,8 @@
3938
"ruby": "3.3.6",
4039
"cloudfoundry-cli": "8.8.1",
4140
"go": "1.23.0",
42-
"temurin-bin-21": "latest"
41+
"temurin-bin-21": "latest",
42+
"redocly": "latest"
4343
},
4444
"shell": {
4545
"init_hook": [

devbox.lock

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,54 @@
14871487
}
14881488
}
14891489
},
1490+
"redocly@latest": {
1491+
"last_modified": "2025-01-25T23:17:58Z",
1492+
"resolved": "github:NixOS/nixpkgs/b582bb5b0d7af253b05d58314b85ab8ec46b8d19#redocly",
1493+
"source": "devbox-search",
1494+
"version": "1.26.0",
1495+
"systems": {
1496+
"aarch64-darwin": {
1497+
"outputs": [
1498+
{
1499+
"name": "out",
1500+
"path": "/nix/store/km1z31a88xqf6yzd10g2g20r68lmnpaz-redocly-1.26.0",
1501+
"default": true
1502+
}
1503+
],
1504+
"store_path": "/nix/store/km1z31a88xqf6yzd10g2g20r68lmnpaz-redocly-1.26.0"
1505+
},
1506+
"aarch64-linux": {
1507+
"outputs": [
1508+
{
1509+
"name": "out",
1510+
"path": "/nix/store/81vbqb3nxr8ca7zycsxcri872hgap27q-redocly-1.26.0",
1511+
"default": true
1512+
}
1513+
],
1514+
"store_path": "/nix/store/81vbqb3nxr8ca7zycsxcri872hgap27q-redocly-1.26.0"
1515+
},
1516+
"x86_64-darwin": {
1517+
"outputs": [
1518+
{
1519+
"name": "out",
1520+
"path": "/nix/store/mzq47b40sbvajy9v17h691j3r3ib3l6f-redocly-1.26.0",
1521+
"default": true
1522+
}
1523+
],
1524+
"store_path": "/nix/store/mzq47b40sbvajy9v17h691j3r3ib3l6f-redocly-1.26.0"
1525+
},
1526+
"x86_64-linux": {
1527+
"outputs": [
1528+
{
1529+
"name": "out",
1530+
"path": "/nix/store/znsd0yp7rfjhf49am3y5n6v4swlzr8wx-redocly-1.26.0",
1531+
"default": true
1532+
}
1533+
],
1534+
"store_path": "/nix/store/znsd0yp7rfjhf49am3y5n6v4swlzr8wx-redocly-1.26.0"
1535+
}
1536+
}
1537+
},
14901538
"rubocop@latest": {
14911539
"last_modified": "2024-08-31T19:22:30Z",
14921540
"resolved": "github:NixOS/nixpkgs/282e35e0762d64800d78e33ff225704baf9e5216#rubocop",
@@ -1752,54 +1800,6 @@
17521800
}
17531801
}
17541802
},
1755-
"swagger-cli@latest": {
1756-
"last_modified": "2024-08-31T10:12:23Z",
1757-
"resolved": "github:NixOS/nixpkgs/5629520edecb69630a3f4d17d3d33fc96c13f6fe#swagger-cli",
1758-
"source": "devbox-search",
1759-
"version": "4.0.4",
1760-
"systems": {
1761-
"aarch64-darwin": {
1762-
"outputs": [
1763-
{
1764-
"name": "out",
1765-
"path": "/nix/store/l97bajrw465kq0ylnkhwkf22myx5wqi2-swagger-cli-4.0.4",
1766-
"default": true
1767-
}
1768-
],
1769-
"store_path": "/nix/store/l97bajrw465kq0ylnkhwkf22myx5wqi2-swagger-cli-4.0.4"
1770-
},
1771-
"aarch64-linux": {
1772-
"outputs": [
1773-
{
1774-
"name": "out",
1775-
"path": "/nix/store/4m3kq0l9xfj8qxh8qfwijf5a95jx0jgw-swagger-cli-4.0.4",
1776-
"default": true
1777-
}
1778-
],
1779-
"store_path": "/nix/store/4m3kq0l9xfj8qxh8qfwijf5a95jx0jgw-swagger-cli-4.0.4"
1780-
},
1781-
"x86_64-darwin": {
1782-
"outputs": [
1783-
{
1784-
"name": "out",
1785-
"path": "/nix/store/ff5wx2b7dswhhsqqkza6xv5npzh927x4-swagger-cli-4.0.4",
1786-
"default": true
1787-
}
1788-
],
1789-
"store_path": "/nix/store/ff5wx2b7dswhhsqqkza6xv5npzh927x4-swagger-cli-4.0.4"
1790-
},
1791-
"x86_64-linux": {
1792-
"outputs": [
1793-
{
1794-
"name": "out",
1795-
"path": "/nix/store/db6z4kinn17pj73gybhxjq25lm7mhmsy-swagger-cli-4.0.4",
1796-
"default": true
1797-
}
1798-
],
1799-
"store_path": "/nix/store/db6z4kinn17pj73gybhxjq25lm7mhmsy-swagger-cli-4.0.4"
1800-
}
1801-
}
1802-
},
18031803
"temurin-bin-21@latest": {
18041804
"last_modified": "2024-10-13T23:44:06Z",
18051805
"resolved": "github:NixOS/nixpkgs/d4f247e89f6e10120f911e2e2d2254a050d0f732#temurin-bin-21",

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
#
8585
# jdwpkgs.rubyPackages.cf-uaac
8686
shellcheck
87-
swagger-cli
87+
redocly
8888
temurin-bin
8989
uutils-coreutils-noprefix
9090
yq-go

0 commit comments

Comments
 (0)