From e5bed143ff02f1e1bdfcefbb4a9c8e7f32f7f8f8 Mon Sep 17 00:00:00 2001 From: Teena Steger Date: Tue, 11 Nov 2025 11:59:01 +0100 Subject: [PATCH] =?UTF-8?q?05:=20L=C3=B6sungen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/05/labor/05_loesungen/uebung1.md | 8 ++ web/05/labor/05_loesungen/uebung2.md | 13 +++ web/05/labor/05_loesungen/uebung3.md | 36 ++++++++ web/05/labor/05_loesungen/uebung4.md | 60 +++++++++++++ web/05/labor/05_loesungen/uebung5.json | 112 +++++++++++++++++++++++++ 5 files changed, 229 insertions(+) create mode 100644 web/05/labor/05_loesungen/uebung1.md create mode 100644 web/05/labor/05_loesungen/uebung2.md create mode 100644 web/05/labor/05_loesungen/uebung3.md create mode 100644 web/05/labor/05_loesungen/uebung4.md create mode 100644 web/05/labor/05_loesungen/uebung5.json diff --git a/web/05/labor/05_loesungen/uebung1.md b/web/05/labor/05_loesungen/uebung1.md new file mode 100644 index 0000000..1ad0d32 --- /dev/null +++ b/web/05/labor/05_loesungen/uebung1.md @@ -0,0 +1,8 @@ +## 1. Lösung + +1.1. Antonette +1.2 10 +1.3 sunt aut facere repellat provident occaecati excepturi optio reprehenderit +1.4 5 +1.5 Ja +1.6 `curl 'https://jsonplaceholder.typicode.com/posts?userId=2` \ No newline at end of file diff --git a/web/05/labor/05_loesungen/uebung2.md b/web/05/labor/05_loesungen/uebung2.md new file mode 100644 index 0000000..e0143d0 --- /dev/null +++ b/web/05/labor/05_loesungen/uebung2.md @@ -0,0 +1,13 @@ +## 2. Lösung + +1. 68eb4a0b-6c49-44e9-aec8-5af947d22141 +```bash +curl https://hp-api.onrender.com/api/characters/staff +``` + +2. +```bash +https://hp-api.onrender.com/api/character/68eb4a0b-6c49-44e9-aec8-5af947d22141 +``` + +3. blond \ No newline at end of file diff --git a/web/05/labor/05_loesungen/uebung3.md b/web/05/labor/05_loesungen/uebung3.md new file mode 100644 index 0000000..f0e04f4 --- /dev/null +++ b/web/05/labor/05_loesungen/uebung3.md @@ -0,0 +1,36 @@ +## 3. Lösung + +#### Staudenpflanzen + +```json +[ + { + "_id": "68fa239f7037b603e8a5af57", + "name": "Lavendel", + "botanischer_name": "Lavandula angustifolia", + "standort": "Sonnig, trocken", + "besonderheiten": "Duftend, bienenfreundlich, winterhart" + }, + { + "_id": "68fa23d77037b603e8a5af59", + "name": "Funkie", + "botanischer_name": "Hosta", + "standort": "Halbschatten bis Schatten", + "besonderheiten": "Dekoratives Laub, schneckenanfällig, robust" + }, + { + "_id": "68fa23de7037b603e8a5af5a", + "name": "Sonnenhut", + "botanischer_name": "Echinacea purpurea", + "standort": "Sonnig", + "besonderheiten": "Heilpflanze, zieht Schmetterlinge, schneckenanfällig" + }, + { + "_id": "68fa23e67037b603e8a5af5b", + "name": "Tränendes Herz", + "botanischer_name": "Lamprocapnos spectabilis", + "standort": "Halbschatten", + "besonderheiten": "Herzförmige Blüten, romantisch, giftig" + } +] +``` \ No newline at end of file diff --git a/web/05/labor/05_loesungen/uebung4.md b/web/05/labor/05_loesungen/uebung4.md new file mode 100644 index 0000000..850c5af --- /dev/null +++ b/web/05/labor/05_loesungen/uebung4.md @@ -0,0 +1,60 @@ +## 4. Lösung + +1. +```json +{ + "name": "Alex", + "alter": 30, + "wohnort": "Berlin" +} +``` + +2. +```json +{ + "produktName": "Kopfhörer", + "preis": 89.99, + "verfuegbarkeit": true, + "farben": ["schwarz", "weiß"] +} + +3. +```json +{ + "benutzername": "maria1999", + "passwort": "abc123", + "rolle": "Admin", + "adresse": { + "strasse": "Bauernring 15", + "stadt": "Weilbach", + "plz": "12345" + } +} +``` + +4. +```json +[ + { + "titel": "Einkaufen gehen", + "erledigt": false + }, + { + "titel": "Rechnung bezahlen", + "erledigt": true + } +] +``` + +5. +```json +{ + "titel": "Was ist VRNnextbike?", + "autor": "VRN Redaktion", + "inhalt": "Nutzer:innen können Fahrräder per App ausleihen und zurückgeben. Die Registrierung ist kostenlos, lediglich eine Zahlungsmittel-Verifizierung ist nötig.", + "kommentar": { + "autor": "Tilla Tränenreich", + "text": "Toller Beitrag! Ich werde mich morgen selbst registrieren und es ausprobieren!" + } +} +``` \ No newline at end of file diff --git a/web/05/labor/05_loesungen/uebung5.json b/web/05/labor/05_loesungen/uebung5.json new file mode 100644 index 0000000..c9dc9b4 --- /dev/null +++ b/web/05/labor/05_loesungen/uebung5.json @@ -0,0 +1,112 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Simple Greeting API", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost:8080" + } + ], + "paths": { + "/hello": { + "get": { + "summary": "Returns a greeting", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "description": "Name of the person to greet", + "schema": { + "type": "string" + }, + "example": "Deepak" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "example": "Hello, Deepak!" + } + } + } + } + }, + "post": { + "summary": "Accepts a plain text name and returns a plain text greeting", + "requestBody": { + "required": true, + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "example": "Deepika" + } + } + }, + "responses": { + "200": { + "description": "Plain text greeting response", + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "example": "Hello, Deepika!" + } + } + } + } + } + }, + "/hello-json": { + "post": { + "summary": "Accepts a json with name and age and returns a plain text greeting", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "example": "Florian" + }, + "age": { + "type": "integer", + "example": 23 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Plain text greeting response", + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "example": "Hello, 23-year-old Florian!" + } + } + } + } + } + } + } +} \ No newline at end of file