From 44a046519dd79a6c1a978e93b2a9f7bd3a47d601 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Fri, 24 May 2024 15:58:06 -0400 Subject: [PATCH] actions: validate swagger definition --- .flox/env/manifest.lock | 2 +- .github/workflows/swagger-validate.yml | 22 ++++++++++++++++++++++ .github/workflows/swagger.yml | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/swagger-validate.yml diff --git a/.flox/env/manifest.lock b/.flox/env/manifest.lock index 7389e4c..3158f69 100644 --- a/.flox/env/manifest.lock +++ b/.flox/env/manifest.lock @@ -1205,4 +1205,4 @@ "nixpkgs" ] } -} +} \ No newline at end of file diff --git a/.github/workflows/swagger-validate.yml b/.github/workflows/swagger-validate.yml new file mode 100644 index 0000000..4770220 --- /dev/null +++ b/.github/workflows/swagger-validate.yml @@ -0,0 +1,22 @@ +name: Swagger Validate +on: [push, pull_request] +jobs: + swagger-validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install nodejs + uses: actions/setup-node@v3 + with: + node-version: '22' + - name: Install java + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + - name: Install openapi-generator-cli + run: | + npm install @openapitools/openapi-generator-cli -g + - name: Validate swagger.json + run: | + openapi-generator-cli validate -i swagger.json diff --git a/.github/workflows/swagger.yml b/.github/workflows/swagger.yml index e810a45..a96310c 100644 --- a/.github/workflows/swagger.yml +++ b/.github/workflows/swagger.yml @@ -13,6 +13,6 @@ jobs: run: | python -m pip install --upgrade pip pip install . - - name: Validate swagger.json + - name: Re-generate swagger.json run: | diff -u swagger.json <(swagger)