diff --git a/.github/workflows/generate-postman-collection.yml b/.github/workflows/generate-postman-collection.yml new file mode 100644 index 00000000..eae48a2b --- /dev/null +++ b/.github/workflows/generate-postman-collection.yml @@ -0,0 +1,32 @@ +name: generate-postman-collection + +on: + push: + paths: + - "src/openklant/components/*/openapi.yaml" + - ".github/workflows/generate-postman-collection.yml" + branches: + - '**' + workflow_dispatch: + +jobs: + run: + runs-on: ubuntu-latest + strategy: + matrix: + component: ['contactgegevens', 'klantinteracties'] + + name: Run with component ${{ matrix.component }} + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + - 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/components/${{ matrix.component }}/openapi.yaml -o ./tests/postman/collection.json --pretty diff --git a/.github/workflows/generate-sdks.yml b/.github/workflows/generate-sdks.yml new file mode 100644 index 00000000..6006710f --- /dev/null +++ b/.github/workflows/generate-sdks.yml @@ -0,0 +1,42 @@ +name: generate-sdks + +on: + push: + paths: + - "src/openklant/components/*/openapi.yaml" + - ".github/workflows/generate-sdks.yml" + branches: + - '**' + workflow_dispatch: + +jobs: + run: + runs-on: ubuntu-latest + strategy: + matrix: + component: ['contactgegevens', 'klantinteracties'] + + name: Run with component ${{ matrix.component }} + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + - name: Install dependencies + run: npm install -g @openapitools/openapi-generator-cli + - name: Determining oas path + id: vars + run: echo ::set-output name=oas::./src/openklant/components/${{ matrix.component }}/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 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+ diff --git a/.github/workflows/lint-oas.yml b/.github/workflows/lint-oas.yml new file mode 100644 index 00000000..ad3f13fd --- /dev/null +++ b/.github/workflows/lint-oas.yml @@ -0,0 +1,30 @@ +name: lint-oas + +on: + push: + paths: + - "src/openklant/components/*/openapi.yaml" + - .github/workflows/lint-oas.yml + branches: + - '**' + workflow_dispatch: + +jobs: + run: + runs-on: ubuntu-latest + strategy: + matrix: + component: ['contactgegevens', 'klantinteracties'] + + name: Run with component ${{ matrix.component }} + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + - name: Install spectral + run: npm install -g @stoplight/spectral@5 + - name: Run OAS linter + run: spectral lint ./src/openklant/components/${{ matrix.component }}/openapi.yaml diff --git a/src/openklant/components/contactgegevens/api/schema.py b/src/openklant/components/contactgegevens/api/schema.py index 4c3164c5..f0d8b551 100644 --- a/src/openklant/components/contactgegevens/api/schema.py +++ b/src/openklant/components/contactgegevens/api/schema.py @@ -9,4 +9,8 @@ "TITLE": "contactgegevens", "DESCRIPTION": description, "VERSION": settings.CONTACTGEGEVENS_API_VERSION, + "TAGS": [ + {"name": "organisaties"}, + {"name": "personen"}, + ], } diff --git a/src/openklant/components/contactgegevens/openapi.yaml b/src/openklant/components/contactgegevens/openapi.yaml index 10432a56..78cfdb29 100644 --- a/src/openklant/components/contactgegevens/openapi.yaml +++ b/src/openklant/components/contactgegevens/openapi.yaml @@ -404,6 +404,9 @@ components: minLength: 4 PaginatedOrganisatieList: type: object + required: + - count + - results properties: count: type: integer @@ -424,6 +427,9 @@ components: $ref: '#/components/schemas/Organisatie' PaginatedPersoonList: type: object + required: + - count + - results properties: count: type: integer @@ -668,3 +674,6 @@ components: in: header name: Authorization description: Token-based authentication with required prefix "Token" +tags: +- name: organisaties +- name: personen diff --git a/src/openklant/components/klantinteracties/api/schema.py b/src/openklant/components/klantinteracties/api/schema.py index 6365b5d2..4e88091b 100644 --- a/src/openklant/components/klantinteracties/api/schema.py +++ b/src/openklant/components/klantinteracties/api/schema.py @@ -9,4 +9,20 @@ "TITLE": "klantinteracties", "DESCRIPTION": description, "VERSION": settings.KLANTINTERACTIES_API_VERSION, + "TAGS": [ + {"name": "actoren"}, + {"name": "actor klantcontacten"}, + {"name": "betrokkenen"}, + {"name": "bijlagen"}, + {"name": "categorie relaties"}, + {"name": "categorieën"}, + {"name": "digitale adressen"}, + {"name": "interne taken"}, + {"name": "klanten contacten"}, + {"name": "onderwerpobjecten"}, + {"name": "partij-identificatoren"}, + {"name": "partijen"}, + {"name": "rekeningnummers"}, + {"name": "vertegenwoordigingen"}, + ], } diff --git a/src/openklant/components/klantinteracties/openapi.yaml b/src/openklant/components/klantinteracties/openapi.yaml index 15e7aff8..56e6055b 100644 --- a/src/openklant/components/klantinteracties/openapi.yaml +++ b/src/openklant/components/klantinteracties/openapi.yaml @@ -3330,13 +3330,11 @@ components: afgehandeldOp: type: string format: date-time - readOnly: true nullable: true description: 'Datum en tijdstip wanneer de interne taak was afgehandeld: EXPERIMENTEEL.' required: - aanleidinggevendKlantcontact - - afgehandeldOp - gevraagdeHandeling - status - toegewezenAanActor @@ -3560,6 +3558,9 @@ components: maxLength: 200 PaginatedActorKlantcontactList: type: object + required: + - count + - results properties: count: type: integer @@ -3580,6 +3581,9 @@ components: $ref: '#/components/schemas/ActorKlantcontact' PaginatedActorList: type: object + required: + - count + - results properties: count: type: integer @@ -3600,6 +3604,9 @@ components: $ref: '#/components/schemas/Actor' PaginatedBetrokkeneList: type: object + required: + - count + - results properties: count: type: integer @@ -3620,6 +3627,9 @@ components: $ref: '#/components/schemas/Betrokkene' PaginatedBijlageList: type: object + required: + - count + - results properties: count: type: integer @@ -3640,6 +3650,9 @@ components: $ref: '#/components/schemas/Bijlage' PaginatedCategorieList: type: object + required: + - count + - results properties: count: type: integer @@ -3660,6 +3673,9 @@ components: $ref: '#/components/schemas/Categorie' PaginatedCategorieRelatieList: type: object + required: + - count + - results properties: count: type: integer @@ -3680,6 +3696,9 @@ components: $ref: '#/components/schemas/CategorieRelatie' PaginatedDigitaalAdresList: type: object + required: + - count + - results properties: count: type: integer @@ -3700,6 +3719,9 @@ components: $ref: '#/components/schemas/DigitaalAdres' PaginatedExpandKlantcontactList: type: object + required: + - count + - results properties: count: type: integer @@ -3720,6 +3742,9 @@ components: $ref: '#/components/schemas/ExpandKlantcontact' PaginatedExpandPartijList: type: object + required: + - count + - results properties: count: type: integer @@ -3740,6 +3765,9 @@ components: $ref: '#/components/schemas/ExpandPartij' PaginatedInterneTaakList: type: object + required: + - count + - results properties: count: type: integer @@ -3760,6 +3788,9 @@ components: $ref: '#/components/schemas/InterneTaak' PaginatedKlantcontactList: type: object + required: + - count + - results properties: count: type: integer @@ -3780,6 +3811,9 @@ components: $ref: '#/components/schemas/Klantcontact' PaginatedOnderwerpobjectList: type: object + required: + - count + - results properties: count: type: integer @@ -3800,6 +3834,9 @@ components: $ref: '#/components/schemas/Onderwerpobject' PaginatedPartijIdentificatorList: type: object + required: + - count + - results properties: count: type: integer @@ -3820,6 +3857,9 @@ components: $ref: '#/components/schemas/PartijIdentificator' PaginatedPartijList: type: object + required: + - count + - results properties: count: type: integer @@ -3840,6 +3880,9 @@ components: $ref: '#/components/schemas/Partij' PaginatedRekeningnummerList: type: object + required: + - count + - results properties: count: type: integer @@ -3860,6 +3903,9 @@ components: $ref: '#/components/schemas/Rekeningnummer' PaginatedVertegenwoordigdenList: type: object + required: + - count + - results properties: count: type: integer @@ -4504,7 +4550,6 @@ components: afgehandeldOp: type: string format: date-time - readOnly: true nullable: true description: 'Datum en tijdstip wanneer de interne taak was afgehandeld: EXPERIMENTEEL.' @@ -4917,3 +4962,18 @@ components: in: header name: Authorization description: Token-based authentication with required prefix "Token" +tags: +- name: actoren +- name: actor klantcontacten +- name: betrokkenen +- name: bijlagen +- name: categorie relaties +- name: categorieën +- name: digitale adressen +- name: interne taken +- name: klanten contacten +- name: onderwerpobjecten +- name: partij-identificatoren +- name: partijen +- name: rekeningnummers +- name: vertegenwoordigingen