Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into feature/swagger-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf Ueberfuhr committed Jan 30, 2024
2 parents b58f2a0 + 8f36607 commit 73c64cb
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
40 changes: 39 additions & 1 deletion openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -245,6 +270,12 @@ paths:
description: Customer could not be found
components:
schemas:
CustomerState:
type: string
enum:
- active
- locked
- disabled
Customer:
required:
- birthdate
Expand All @@ -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
Expand Down Expand Up @@ -315,4 +353,4 @@ components:
securitySchemes:
openId:
type: openIdConnect
openIdConnectUrl: https://<keycloak-server>/.well-known/openid-configuration
openIdConnectUrl: https://my-keycloak-server/.well-known/openid-configuration

0 comments on commit 73c64cb

Please sign in to comment.