From 7dd1da91a22b994be86457a5a01572763fb2ff31 Mon Sep 17 00:00:00 2001 From: Kavindu Dodanduwa Date: Thu, 9 May 2024 14:03:21 -0700 Subject: [PATCH] add OpenAPI spec validator based on redocly cli 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