forked from WEB-IMB-WS2526/lab-development-imb
05: Lösungen
parent
5b84c11f54
commit
e5bed143ff
|
|
@ -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`
|
||||||
|
|
@ -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
|
||||||
|
|
@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
@ -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!"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
@ -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!"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue