Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added OAS checks #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/generate-postman-collection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: generate-postman-collection

on:
push:
paths:
- "src/openklant/api/v*/openapi.yaml"
- ".github/workflows/generate-postman-collection.yml"
branches:
- '**'
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ 'v1' ]

name: Run with version v${{ matrix.version }}

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Install dependencies
run: npm install -g openapi-to-postmanv2
- name: Create tests folder
run: mkdir -p ./tests/postman
- name: Generate Postman collection
run: openapi2postmanv2 -s ./src/openklant/api/${{ matrix.version }}/openapi.yaml -o ./tests/postman/collection.json --pretty
45 changes: 45 additions & 0 deletions .github/workflows/generate-sdks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: generate-sdks

on:
push:
paths:
- "src/openklant/api/v*/openapi.yaml"
- ".github/workflows/generate-sdks.yml"
branches:
- '**'
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ 'v1' ]

name: Run with version v${{ matrix.version }}

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Install dependencies
run: npm install -g @openapitools/openapi-generator-cli
- name: Determing oas path
id: vars
run: echo ::set-output name=oas::./src/openklant/api/${{ matrix.version }}/openapi.yaml
- name: Validate schema
run: openapi-generator-cli validate -i ${{ steps.vars.outputs.oas }}
- name: Generate Java client
run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
-o ./sdks/java -g java --additional-properties=dateLibrary=java8,java8=true,optionalProjectFile=false,optionalAssemblyInfo=false
# - name: Generate .NET Core client
# run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
# -o ./sdks/netcore -g csharp-netcore --additional-properties=optionalProjectFile=false,optionalAssemblyInfo=false
# - name: Generate .NET Full Framework client
# run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
# -o ./sdks/net -g csharp --additional-properties=optionalProjectFile=false,optionalAssemblyInfo=false
- name: Generate Python client
run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
-o ./sdks/python -g python --additional-properties=optionalProjectFile=false,optionalAssemblyInfo=false+
30 changes: 30 additions & 0 deletions .github/workflows/lint-oas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: lint-oas

on:
push:
paths:
- "src/openklant/api/v*/openapi.yaml"
- ".github/workflows/lint-oas.yml"
branches:
- '**'
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ 'v1' ]

name: Run with version v${{ matrix.version }}

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Install spectral
run: npm install -g @stoplight/spectral@5
- name: Run OAS linter
run: spectral lint ./src/openklant/api/${{ matrix.version }}/openapi.yaml
Loading