From 600f16d625d8b4c8e7f8a82fb4dd1a77f80bfcbc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?=
<67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Tue, 9 Jul 2024 21:57:19 +0900
Subject: [PATCH] =?UTF-8?q?fix(backend):=20api-doc=E3=82=92Scalar=E3=81=AB?=
=?UTF-8?q?=E5=A4=89=E6=9B=B4=20(#14152)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix(backend): api-docをScalarに変更
* Update Changelog
---
CHANGELOG.md | 1 +
packages/backend/assets/api-doc.html | 20 ++++++++++++++++
packages/backend/assets/redoc.html | 24 -------------------
.../api/openapi/OpenApiServerService.ts | 2 +-
.../src/server/api/openapi/gen-spec.ts | 1 -
5 files changed, 22 insertions(+), 26 deletions(-)
create mode 100644 packages/backend/assets/api-doc.html
delete mode 100644 packages/backend/assets/redoc.html
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1bcf721676..b99a2cbc53 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@
- Fix: Dockerコンテナの立ち上げ時に`pnpm`のインストールで固まることがある問題
### Client
+- Enhance: 内蔵APIドキュメントのデザイン・パフォーマンスを改善
- Fix: `/about#federation` ページなどで各インスタンスのチャートが表示されなくなっていた問題を修正
- Fix: ユーザーページの追加情報のラベルを投稿者のサーバーの絵文字で表示する (#13968)
- Fix: リバーシの対局を正しく共有できないことがある問題を修正
diff --git a/packages/backend/assets/api-doc.html b/packages/backend/assets/api-doc.html
new file mode 100644
index 0000000000..19e0349d47
--- /dev/null
+++ b/packages/backend/assets/api-doc.html
@@ -0,0 +1,20 @@
+
+
+
+ Misskey API
+
+
+
+
+
+
+
+
+
diff --git a/packages/backend/assets/redoc.html b/packages/backend/assets/redoc.html
deleted file mode 100644
index 2557b4532e..0000000000
--- a/packages/backend/assets/redoc.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- Misskey API
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/backend/src/server/api/openapi/OpenApiServerService.ts b/packages/backend/src/server/api/openapi/OpenApiServerService.ts
index 5210e4d2bc..f124aa9f39 100644
--- a/packages/backend/src/server/api/openapi/OpenApiServerService.ts
+++ b/packages/backend/src/server/api/openapi/OpenApiServerService.ts
@@ -25,7 +25,7 @@ export class OpenApiServerService {
public createServer(fastify: FastifyInstance, _options: FastifyPluginOptions, done: (err?: Error) => void) {
fastify.get('/api-doc', async (_request, reply) => {
reply.header('Cache-Control', 'public, max-age=86400');
- return await reply.sendFile('/redoc.html', staticAssets);
+ return await reply.sendFile('/api-doc.html', staticAssets);
});
fastify.get('/api.json', (_request, reply) => {
reply.header('Cache-Control', 'public, max-age=600');
diff --git a/packages/backend/src/server/api/openapi/gen-spec.ts b/packages/backend/src/server/api/openapi/gen-spec.ts
index 2a14270a24..efa47a6986 100644
--- a/packages/backend/src/server/api/openapi/gen-spec.ts
+++ b/packages/backend/src/server/api/openapi/gen-spec.ts
@@ -15,7 +15,6 @@ export function genOpenapiSpec(config: Config, includeSelfRef = false) {
info: {
version: config.version,
title: 'Misskey API',
- 'x-logo': { url: '/static-assets/api-doc.png' },
},
externalDocs: {