Update API Doc

This commit is contained in:
Rudi committed 2026-10-13 19:26:56 +02:00
1 parent 5d6d8f15f3
commit 5a56245218
10 files changed
+1196 -229

No files matched your search

+39 -6
View File
@@ -1,3 +1,5 @@
// @/app/api/songbooks/[songBookId]/songs/route.ts
import { NextResponse } from "next/server";
import { getSongByNumber } from "@/lib/db/songbooksongs";
@@ -9,27 +11,58 @@ interface RouteParams {
/**
* @openapi
* /api/songbooks/{id}/songs:
* /api/songbooks/{songBookId}/songs:
* get:
* summary: Einen Song nach Nummer in einem Songbook suchen
* tags:
* - Songbook
* - Songbooks
* parameters:
* - in: path
* name: id
* name: songBookId
* required: true
* schema:
* type: integer
* description: Die ID des Songbooks
* example: 1
* - in: query
* name: number
* required: true
* schema:
* type: string
* description: Die Nummer des Songs im Songbook
* example: "123"
* - in: query
* name: n
* required: false
* schema:
* type: string
* description: Alias für `number`
* example: "123"
* responses:
* 200:
* description: Songbook erfolgreich gefunden
* description: Song im Songbook erfolgreich gefunden
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/SongBookEntry'
* 400:
* description: Ungültige Songbook-ID
* description: Ungültige Songbook-ID oder fehlender number-Parameter
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Error'
* 404:
* description: Songbook nicht gefunden
* description: Songbook oder Song nicht gefunden
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Error'
* 500:
* description: Serverfehler
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Error'
*/
export async function GET(request: Request, { params }: RouteParams) {
try {