From e834ff623b144fe2b040846bdca7a8fd6ae93b17 Mon Sep 17 00:00:00 2001 From: marco Date: Mon, 31 Aug 2026 15:47:33 +0200 Subject: [PATCH] added api design --- api-design.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 api-design.md diff --git a/api-design.md b/api-design.md new file mode 100644 index 0000000..8d34ffc --- /dev/null +++ b/api-design.md @@ -0,0 +1,68 @@ +# Endpunkte + +GET /api/person -> Get all persons +GET /api/person/username/{username} -> Get person +POST /api/person -> Create +PUT /api/person/username/{username} -> Update +DELETE /api/person/username/{username} -> Delete + +# Personen-Modell + +String username +String realName +DateOnly birthday + +# Beispiele +## Beispiel 1 +Request: +POST /api/person +{ + "username": "marco", + "realName": "Marco", + "birthday": "2000-01-26" +} + +Response: 201 + +## Beispiel 2 +Request: +POST /api/person +{ + "username": "m", + "realName": "Marco", + "birthday": "2000-01-26" +} + +Response: 400 + +## Beispel 3 + +1. Request: +POST /api/person +{ + "username": "marco", + "realName": "Marco", + "birthday": "2000-01-26" +} +Response: 201 + +2. Request: +POST /api/person +{ + "username": "marco", + "realName": "Marco", + "birthday": "2000-01-26" +} +Response: 409 + +## Beispiel 4 + + +Request: +POST /api/person +{ + "username": "marco", + "realName": "Marco", + "birthday": "2020-01-26" +} +Response: 400 Person muss 16 Jahre alt sein