Aufgabe 6

branch-francesca
Francesca Bläse 2025-11-11 12:33:42 +00:00
parent f8a77ea1e9
commit a0b6a56ef7
4 changed files with 266 additions and 0 deletions

View File

@ -0,0 +1,65 @@
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
2.1)68eb4a0b-6c49-44e9-aec8-5af947d22141
curl https://hp-api.onrender.com/api/characters/staff
2.2) curl https://hp-api.onrender.com/api/character/68eb4a0b-6c49-44e9-aec8-5af947d22141
2.3) blond
3) siehe Datei staudenpflanzen.json
4.1)
{
"name": "Alex",
"alter": 30,
"wohnort": "Berlin"
}
4.2)
{
"produktname": "Kopfhörer",
"preis": 98.99,
"verfügbarkeit": "Ja",
"farben":["schwarz", "weiß"]
}
4.3)
{
"benutzername": "maria1999",
"passwort": "abc123",
"rolle": "Admin",
"adresse": {
"straße": "Bauernring 15",
"stadt": "Weilbach",
"plz": 12345
}
}
4.4)
[
{
"titel": "Task1",
"erledigt": true
},
{
"titel": "Task2",
"erledigt": false
}
]
4.5)
{
"titel": "Blabla",
"autor": "Blubb",
"inhalt": "Nix",
"kommentar": {
"autor": "Niemand",
"text": "Auch nix!"
}
}

View File

@ -0,0 +1,99 @@
{
"openapi": "3.0.0",
"info": {
"title": "Simple Greeting API",
"version": "1.0.0"
},
"servers": [
{
"url": "http://localhost:8080"
}
],
"paths": {
"/hello": {
"get": {
"parameters": [
{
"name": "name",
"in": "query",
"description": "Name",
"required": false,
"schema": {"type": "string"}
}
],
"summary": "Returns a greeting",
"responses": {
"200": {
"description": "Greeting response in plain text.",
"content": {
"text/plain": {
"schema": {
"type": "string"
},
"example": "Hello!"
}
}
}
}
},
"post": {
"requestBody":{
"required": true,
"content": {
"text/plain":{
"schema":{"type": "string"}
}
}
},
"summary": "Returns a plain text greeting",
"responses": {
"200": {
"description": "Plain text greeting response",
"content": {
"text/plain": {
"schema": {
"type": "string"
},
"example": "Hello!"
}
}
}
}
}
},
"/hello-json": {
"post": {
"summary": "Returns a greeting using a JSON body",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": { "type": "string" },
"age": { "type": "integer" }
},
"required": ["name", "age"]
},
"example": {
"name": "Florian",
"age": 23
}
}
}
},
"responses": {
"200": {
"description": "Greeting response in plain text",
"content": {
"text/plain": {
"schema": { "type": "string" },
"example": "Hello Florian, you are 23!" }
}
}
}
}
}
}
}

View File

@ -0,0 +1,30 @@
[
{
"_id": "6909f3da83629c03e8adedd7",
"name": "Lavendel",
"botanischer_name": "Lavandula angustifolia",
"standort": "Sonnig, trocken",
"besonderheiten": "Duftend, bienenfreundlich, winterhart"
},
{
"_id": "6909f3db83629c03e8adedd9",
"name": "Funkie",
"botanischer_name": "Hosta",
"standort": "Halbschatten bis Schatten",
"besonderheiten": "Dekoratives Laub, schneckenanfällig, robust"
},
{
"_id": "6909f3db83629c03e8adedda",
"name": "Sonnenhut",
"botanischer_name": "Echinacea purpurea",
"standort": "Sonnig",
"besonderheiten": "Heilpflanze, zieht Schmetterlinge, schneckenanfällig"
},
{
"_id": "6909f3dc83629c03e8adeddb",
"name": "Tränendes Herz",
"botanischer_name": "Lamprocapnos spectabilis",
"standort": "Halbschatten",
"besonderheiten": "Herzförmige Blüten, romantisch, giftig"
}
]

View File

@ -0,0 +1,72 @@
openapi: 3.0.0
info:
title: Workshop-Anmeldung API
version: 1.0.0
servers:
- url: https://web-637691723779.europe-west2.run.app
paths:
/registrierung:
post:
summary: Anmeldung zu einem Workshop
description: API für Anmeldedaten eines den Workshops.
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/WorkshopForm'
application/json:
schema:
$ref: '#/components/schemas/WorkshopForm'
responses:
'200':
description: Erfolgreiche Anmeldung
'400':
description: Ungültige Eingabe
components:
schemas:
WorkshopForm:
type: object
properties:
vorname:
type: string
example: "Max"
nachname:
type: string
example: "Mustermann"
email:
type: string
format: email
example: "max@beispiel.de"
handy:
type: string
example: "+491751234567"
kurs:
type: string
example: "Webentwicklung Basics"
session:
type: string
enum: ["vormittag", "nachmittag", "abend", "wochenende"]
example: "abend"
agb:
type: string
enum: ["ja", "on"]
example: "on"
newsletter:
type: string
enum: ["ja", "on"]
example: "ja"
equipment:
type: string
enum: ["ja", "on"]
example: "ja"
format:
type: string
enum: ["online", "praesenz"]
example: "online"
required:
- vorname
- nachname
- email
- agb
- format