From a07d753da84191bc8c185a7bcd6d73fab9529b5d Mon Sep 17 00:00:00 2001 From: YuzuRyo61 Date: Sat, 6 Mar 2021 22:34:11 +0900 Subject: APIドキュメントの改善 (#6757) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update api document in admin/announcements * Update api document in announcements * Update api document in i/read-announcements * Update api document in username/available * Update api document & Fix typo in API 403 error * Update api document * Update api document * Update api document * Fix API permission definition * Update api document * Update api document * Update api document * Update api document * Update api document * Update api document * Update api document * Update api document * Fix bug in users (api) * Apply reviews #6757 * Apply reviews #6757 Co-authored-by: syuilo --- src/server/api/endpoints/clips/create.ts | 6 ++++++ src/server/api/endpoints/clips/list.ts | 10 ++++++++++ src/server/api/endpoints/clips/notes.ts | 10 ++++++++++ src/server/api/endpoints/clips/show.ts | 6 ++++++ src/server/api/endpoints/clips/update.ts | 6 ++++++ 5 files changed, 38 insertions(+) (limited to 'src/server/api/endpoints/clips') diff --git a/src/server/api/endpoints/clips/create.ts b/src/server/api/endpoints/clips/create.ts index 0d122dbb9b..b26c42c56c 100644 --- a/src/server/api/endpoints/clips/create.ts +++ b/src/server/api/endpoints/clips/create.ts @@ -23,6 +23,12 @@ export const meta = { validator: $.optional.nullable.str.range(1, 2048) } }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Clip' + } }; export default define(meta, async (ps, user) => { diff --git a/src/server/api/endpoints/clips/list.ts b/src/server/api/endpoints/clips/list.ts index 6ede8ea0fc..6b90b114df 100644 --- a/src/server/api/endpoints/clips/list.ts +++ b/src/server/api/endpoints/clips/list.ts @@ -7,6 +7,16 @@ export const meta = { requireCredential: true as const, kind: 'read:account', + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Clip' + } + } }; export default define(meta, async (ps, me) => { diff --git a/src/server/api/endpoints/clips/notes.ts b/src/server/api/endpoints/clips/notes.ts index 13983d99f7..6a507e2036 100644 --- a/src/server/api/endpoints/clips/notes.ts +++ b/src/server/api/endpoints/clips/notes.ts @@ -39,6 +39,16 @@ export const meta = { code: 'NO_SUCH_CLIP', id: '1d7645e6-2b6d-4635-b0fe-fe22b0e72e00' } + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Note' + } } }; diff --git a/src/server/api/endpoints/clips/show.ts b/src/server/api/endpoints/clips/show.ts index dc730d64a3..8c285d88b5 100644 --- a/src/server/api/endpoints/clips/show.ts +++ b/src/server/api/endpoints/clips/show.ts @@ -23,6 +23,12 @@ export const meta = { code: 'NO_SUCH_CLIP', id: 'c3c5fe33-d62c-44d2-9ea5-d997703f5c20' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Clip' } }; diff --git a/src/server/api/endpoints/clips/update.ts b/src/server/api/endpoints/clips/update.ts index 4a1a31eb95..041691da2a 100644 --- a/src/server/api/endpoints/clips/update.ts +++ b/src/server/api/endpoints/clips/update.ts @@ -35,6 +35,12 @@ export const meta = { code: 'NO_SUCH_CLIP', id: 'b4d92d70-b216-46fa-9a3f-a8c811699257' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Clip' } }; -- cgit v1.2.3-freya