From f3eea75c935b074d4368a8976c3a32da5745b614 Mon Sep 17 00:00:00 2001 From: Jai0401 <21cs3025@rgipt.ac.in> Date: Thu, 25 Apr 2024 13:04:17 +0530 Subject: [PATCH] Added Open API validator --- .github/workflows/openapi_validation.yaml | 65 +++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/openapi_validation.yaml diff --git a/.github/workflows/openapi_validation.yaml b/.github/workflows/openapi_validation.yaml new file mode 100644 index 00000000..8e050b8e --- /dev/null +++ b/.github/workflows/openapi_validation.yaml @@ -0,0 +1,65 @@ +name: Validate OpenAPI + +on: + pull_request: + branches: + - master + - draft + +jobs: + validate_meta: + name: Meta OpenAPI Schema Validation + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install Node.js and NPM + uses: actions/setup-node@v2 + with: + node-version: 16 + + - name: Install IBM OpenAPI Validator + run: npm install -g @ibm-cloud/openapi-validator + + - name: Validate OpenAPI schema for meta.yaml + run: openapi-validator ./api/meta/build/meta.yaml + + validate_registry: + name: Registry OpenAPI Schema Validation + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install Node.js and NPM + uses: actions/setup-node@v2 + with: + node-version: 16 + + - name: Install IBM OpenAPI Validator + run: npm install -g @ibm-cloud/openapi-validator + + - name: Validate OpenAPI schema for registry.yaml + run: openapi-validator ./api/registry/build/registry.yaml + + validate_transaction: + name: Transaction OpenAPI Schema Validation + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install Node.js and NPM + uses: actions/setup-node@v2 + with: + node-version: 16 + + - name: Install IBM OpenAPI Validator + run: npm install -g @ibm-cloud/openapi-validator + + - name: Validate OpenAPI schema for transaction.yaml + run: openapi-validator ./api/transaction/build/transaction.yaml