From f6f3ebd825bb86549a33acb3646725747d73744b Mon Sep 17 00:00:00 2001 From: dkoeni <116151702+dkoeni@users.noreply.github.com> Date: Fri, 22 Sep 2023 13:21:16 +0200 Subject: [PATCH 1/3] added codeowners and lint workflow --- .github/CODEOWNERS | 7 +++++++ .github/workflows/lint.yaml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/lint.yaml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..ba84dd5 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,7 @@ +# Each line is a file pattern followed by one or more owners. These users are requested for a code review by default. +# More details are here: https://help.github.com/articles/about-codeowners/ + +# The '*' pattern is global owners. +# Order is important. The last matching pattern has the most precedence. + +* @dkoeni @swissfintechinnovations/pk-stream-lead diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..0d727d9 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,31 @@ +name: Lint yaml-files + +on: + pull_request: + workflow_dispatch: + +jobs: + pr-yaml-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout Lint Repo + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} # checkout last commit of PR instead of merge commit + + - name: Checkout Yamllint Config Repo + uses: actions/checkout@v3 + with: + repository: swissfintechinnovations/.github + path: .github + + # - name: Install yamllint + # run: pip install yamllint + + - name: get commit message + id: skip + run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B | tr -d '\n')" >> $GITHUB_OUTPUT # set last commit message as env file (since env var will be not supported) + + - name: Lint yaml APIs + if: "!contains(steps.skip.outputs.COMMIT_MESSAGE, '[skip-workflow]')" # check commit message via env var - skip step if [skip-workflow] is set + run: yamllint -c .github/workflows/.yamllint *.yaml From 6ce2e481ad2a3297a65cff6ca9ea57191ef2bb34 Mon Sep 17 00:00:00 2001 From: dkoeni <116151702+dkoeni@users.noreply.github.com> Date: Fri, 22 Sep 2023 13:32:21 +0200 Subject: [PATCH 2/3] add test spec --- test.yaml | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 test.yaml diff --git a/test.yaml b/test.yaml new file mode 100644 index 0000000..1df1b5b --- /dev/null +++ b/test.yaml @@ -0,0 +1,87 @@ +openapi: 3.0.0 +info: + version: 3.3.0 + title: Common Mortgage API (Public) + description: > + This specification defines a common mortgage API for mortgages as used in Switzerland. + The API is supposed to be used by requesting parties who want to get, extend, or transfer mortgages from and to financial institutions. + This specification uses schema definitions from the Common Data Model v1.2.2. + termsOfService: Tbd + contact: + email: info@common-api.ch + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html +servers: + - url: https://mortgage.common-api.ch +externalDocs: + description: Find out more about SFTI API specifications + url: https://www.common-api.ch +tags: + - name: tag + description: description + +security: + - ApiKeyAuth: [] + - OAuth2: + - read + - write + +paths: + /test: + get: + tags: + - tag + summary: Test endpoint + description: This is a get endpoint, intended to deserve as an example. + parameters: + - $ref: '#/components/parameters/test' + responses: + '200': + headers: + X-Correlation-ID: + $ref: '#/components/headers/X-Correlation-ID' + description: Paginated list of all mortgage cases with all related information sorted by caseId. + content: + application/json: + schema: + type: object + properties: + caseList: + type: array + items: + $ref: '#/components/schemas/MortgageCase' + _links: + $ref: '#/components/schemas/linksPagination' + +components: + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: X-API-Key + + OAuth2: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/oauth/authorize + tokenUrl: https://example.com/oauth/token + scopes: + read: Grants read access + write: Grants write access + + schemas: + parameters: + test: + name: test + in: path + description: Uuid v4 + required: true + schema: + type: string + format: uuid + example: bcb5d762-8d28-43a2-9398-393b2e8d56ba + headers: + responses: + From bc714044b8bd3c36292986d658b7ce0ff91d1ab4 Mon Sep 17 00:00:00 2001 From: dkoeni <116151702+dkoeni@users.noreply.github.com> Date: Fri, 22 Sep 2023 13:33:21 +0200 Subject: [PATCH 3/3] typo --- test.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/test.yaml b/test.yaml index 1df1b5b..38d0896 100644 --- a/test.yaml +++ b/test.yaml @@ -84,4 +84,3 @@ components: example: bcb5d762-8d28-43a2-9398-393b2e8d56ba headers: responses: -