From b5d68ef7b524eebbf068f55a2b2c8345193415cb Mon Sep 17 00:00:00 2001 From: ralf-ueberfuhr-ars <67416181+ralf-ueberfuhr-ars@users.noreply.github.com> Date: Tue, 30 Jan 2024 09:15:44 +0100 Subject: [PATCH 1/3] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b093151..ba7acbc 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,10 @@ Darauf basierend haben wir unsere REST-API für den _AccountService_ designt: ## SOAP vs. REST vs. GraphQL +Ein Repository mit Implementierungen für Spring Boot sowie ergänzend gRPC findest Du [hier](https://github.com/ueberfuhr/api-comparison). + Kriterium| SOAP | REST | GraphQL -------- |-------- | -------- | -------- HTTP | nur Überträger (nur POST, nur 1 URL) | möglichst vollständig | nur Überträger (nur POST, nur 1 URL) Austauschformat | XML (SOAP XSD, W3C-Standards) | JSON o.a. (Content Negotiation) | JSON (Query Syntax in Request Body) -Vorteil | Nutzen der W3C-XML-*-Standards | Kompatibilität mit HTTP-Netzwerk-Komponenten (Proxies, Firewalls,...), einfaches Ansprechen vom Frontend | Dynamische Datenstrukturen bei der Abfrage (Lazy Loading in der Implementierung), JSON erlaubt Aufrufe vom Frontend wie REST \ No newline at end of file +Vorteil | Nutzen der W3C-XML-*-Standards | Kompatibilität mit HTTP-Netzwerk-Komponenten (Proxies, Firewalls,...), einfaches Ansprechen vom Frontend | Dynamische Datenstrukturen bei der Abfrage (Lazy Loading in der Implementierung), JSON erlaubt Aufrufe vom Frontend wie REST From 6190ec578d1a4215bbfdc1301cc9d3b1d7ba3648 Mon Sep 17 00:00:00 2001 From: Ralf Ueberfuhr Date: Tue, 30 Jan 2024 14:01:21 +0100 Subject: [PATCH 2/3] Add customer state and PATCH to update the customer state. --- openapi.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/openapi.yml b/openapi.yml index 18de36f..28a5f60 100644 --- a/openapi.yml +++ b/openapi.yml @@ -19,6 +19,11 @@ paths: tags: - customers summary: Read all customers + parameters: + - name: state + in: query + schema: + $ref: "#/components/schemas/CustomerState" responses: '200': description: Customers were read successfully @@ -93,6 +98,26 @@ paths: description: Customer is invalid '404': description: Customer could not be found + patch: + tags: + - customers + summary: Update the status of the customer + security: + - openId: + - writer_access + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/CustomerPatch' + required: true + responses: + '204': + description: Customer state wassuccessfully updated + '400': + description: Request body is invalid + '404': + description: Customer could not be found delete: tags: - customers @@ -245,6 +270,12 @@ paths: description: Customer could not be found components: schemas: + CustomerState: + type: string + enum: + - active + - locked + - disabled Customer: required: - birthdate @@ -262,6 +293,13 @@ components: birthdate: type: string format: date + state: + $ref: "#/components/schemas/CustomerState" + CustomerPatch: + type: object + properties: + state: + $ref: "#/components/schemas/CustomerState" Address: required: - city From 8f36607c283ede9e0e0c6e85e57ed2bf8b4428c6 Mon Sep 17 00:00:00 2001 From: Ralf Ueberfuhr Date: Tue, 30 Jan 2024 14:05:36 +0100 Subject: [PATCH 3/3] Fix URL to keycloak --- openapi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi.yml b/openapi.yml index 28a5f60..ed1dfa1 100644 --- a/openapi.yml +++ b/openapi.yml @@ -353,4 +353,4 @@ components: securitySchemes: openId: type: openIdConnect - openIdConnectUrl: https:///.well-known/openid-configuration + openIdConnectUrl: https://my-keycloak-server/.well-known/openid-configuration