From f8a53f0d61c37b21ae557c0398a0a7cec41da61c Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Fri, 27 Dec 2024 01:43:03 +0900 Subject: [PATCH] fix(api-server): fix swagger --- src/plugins/api-server/backend/routes/control.ts | 12 ------------ src/plugins/api-server/backend/scheme/auth.ts | 6 ------ 2 files changed, 18 deletions(-) diff --git a/src/plugins/api-server/backend/routes/control.ts b/src/plugins/api-server/backend/routes/control.ts index 8a1d4e8d..0b6fc411 100644 --- a/src/plugins/api-server/backend/routes/control.ts +++ b/src/plugins/api-server/backend/routes/control.ts @@ -6,7 +6,6 @@ import getSongControls from '@/providers/song-controls'; import { AddSongToQueueSchema, - AuthHeadersSchema, GoBackSchema, GoForwardScheme, MoveSongInQueueSchema, @@ -116,7 +115,6 @@ const routes = { summary: 'seek', description: 'Seek to a specific time in the current song', request: { - headers: AuthHeadersSchema, body: { description: 'seconds to seek to', content: { @@ -138,7 +136,6 @@ const routes = { summary: 'go back', description: 'Move the current song back by a number of seconds', request: { - headers: AuthHeadersSchema, body: { description: 'seconds to go back', content: { @@ -161,7 +158,6 @@ const routes = { summary: 'go forward', description: 'Move the current song forward by a number of seconds', request: { - headers: AuthHeadersSchema, body: { description: 'seconds to go forward', content: { @@ -213,7 +209,6 @@ const routes = { summary: 'switch repeat', description: 'Switch the repeat mode', request: { - headers: AuthHeadersSchema, body: { description: 'number of times to click the repeat button', content: { @@ -235,7 +230,6 @@ const routes = { summary: 'set volume', description: 'Set the volume of the player', request: { - headers: AuthHeadersSchema, body: { description: 'volume to set', content: { @@ -257,7 +251,6 @@ const routes = { summary: 'set fullscreen', description: 'Set the fullscreen state of the player', request: { - headers: AuthHeadersSchema, body: { description: 'fullscreen state', content: { @@ -387,7 +380,6 @@ const routes = { summary: 'add song to queue', description: 'Add a song to the queue', request: { - headers: AuthHeadersSchema, body: { description: 'video id of the song to add', content: { @@ -409,7 +401,6 @@ const routes = { summary: 'move song in queue', description: 'Move a song in the queue', request: { - headers: AuthHeadersSchema, params: QueueParamsSchema, body: { description: 'index to move the song to', @@ -432,7 +423,6 @@ const routes = { summary: 'remove song from queue', description: 'Remove a song from the queue', request: { - headers: AuthHeadersSchema, params: QueueParamsSchema, }, responses: { @@ -447,7 +437,6 @@ const routes = { summary: 'set queue index', description: 'Set the current index of the queue', request: { - headers: AuthHeadersSchema, body: { description: 'index to move the song to', content: { @@ -480,7 +469,6 @@ const routes = { summary: 'search for a song', description: 'search for a song', request: { - headers: AuthHeadersSchema, body: { description: 'search query', content: { diff --git a/src/plugins/api-server/backend/scheme/auth.ts b/src/plugins/api-server/backend/scheme/auth.ts index 9e685c0d..536011b1 100644 --- a/src/plugins/api-server/backend/scheme/auth.ts +++ b/src/plugins/api-server/backend/scheme/auth.ts @@ -1,11 +1,5 @@ import { z } from '@hono/zod-openapi'; -export const AuthHeadersSchema = z.object({ - authorization: z.string().openapi({ - example: 'Bearer token', - }), -}); - export type JWTPayload = z.infer; export const JWTPayloadSchema = z.object({ id: z.string(),