From 1d31e7b7c3b70882a53dd3f8bc7a68e5197e22d7 Mon Sep 17 00:00:00 2001 From: Kavindu Dodanduwa Date: Mon, 13 May 2024 06:18:38 -0700 Subject: [PATCH 1/2] add OpenAPI spec validator based on redocly cli (#15) Signed-off-by: Kavindu Dodanduwa --- .github/workflows/spec-validate.yaml | 20 ++++++++++++++++++++ service/openapi.yaml | 4 ++++ 2 files changed, 24 insertions(+) create mode 100644 .github/workflows/spec-validate.yaml diff --git a/.github/workflows/spec-validate.yaml b/.github/workflows/spec-validate.yaml new file mode 100644 index 0000000..9bb47e9 --- /dev/null +++ b/.github/workflows/spec-validate.yaml @@ -0,0 +1,20 @@ +name: OpenAPI spec validation action + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Run OpenAPI spec validation + run: | + docker run --rm -v $PWD:/spec redocly/cli lint ./service/openapi.yaml + echo "{exit_code}={$?}" >> $GITHUB_STATE \ No newline at end of file diff --git a/service/openapi.yaml b/service/openapi.yaml index 8783fce..55f34ef 100644 --- a/service/openapi.yaml +++ b/service/openapi.yaml @@ -1,4 +1,6 @@ openapi: 3.1.0 +servers: + - url: / info: version: 0.1.0 title: OpenFeature Remote Evaluation Protocol (OFREP) @@ -49,6 +51,7 @@ paths: $ref: '#/components/schemas/generalErrorResponse' /ofrep/v1/evaluate/flags/{key}: post: + summary: OFREP single flag evaluation contract description: OFREP single flag evaluation request parameters: - name: key @@ -102,6 +105,7 @@ paths: $ref: '#/components/schemas/generalErrorResponse' /ofrep/v1/evaluate/flags: post: + summary: OFREP bulk flag evaluation contract description: OFREP bulk evaluation request parameters: - in: header From dbfaaa15e3dd5a524f0605d910feaa9a20a474fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 09:49:53 +0200 Subject: [PATCH 2/2] chore(deps): update actions/checkout action to v4 (#16) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/spec-validate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec-validate.yaml b/.github/workflows/spec-validate.yaml index 9bb47e9..2a990b3 100644 --- a/.github/workflows/spec-validate.yaml +++ b/.github/workflows/spec-validate.yaml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Run OpenAPI spec validation run: |