From 4474e2beba80706dfa4bc9159e083918fc4fd5e4 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Tue, 8 Aug 2023 16:21:59 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=83=AA=E3=82=A2=E3=82=AF=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=81=AEAPI=E5=AE=9A=E7=BE=A9=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/openapi/api.yaml | 95 +++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/src/main/resources/openapi/api.yaml b/src/main/resources/openapi/api.yaml index 3cc79aab..e07dec94 100644 --- a/src/main/resources/openapi/api.yaml +++ b/src/main/resources/openapi/api.yaml @@ -74,6 +74,71 @@ paths: $ref: "#/components/responses/NotFoundOrForbidden" 429: $ref: "#/components/responses/TooManyRequests" + /posts/{postId}/reactions: + get: + summary: リアクションを数件返す + security: + - BearerAuth: [ ] + parameters: + - $ref: "#/components/parameters/postId" + responses: + 200: + description: 成功 + content: + application/json: + schema: + $ref: "#/components/schemas/ReactionResponse" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 404: + $ref: "#/components/responses/NotFoundOrForbidden" + 429: + $ref: "#/components/responses/TooManyRequests" + + post: + summary: リアクションを付ける + security: + - BearerAuth: [ ] + parameters: + - $ref: "#/components/parameters/postId" + requestBody: + description: 付けるリアクション + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Reaction" + responses: + 200: + description: 成功 + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 404: + $ref: "#/components/responses/NotFoundOrForbidden" + 429: + $ref: "#/components/responses/TooManyRequests" + delete: + summary: リアクションを削除する + security: + - BearerAuth: [ ] + parameters: + - $ref: "#/components/parameters/postId" + responses: + 200: + description: 成功 + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 404: + $ref: "#/components/responses/NotFoundOrForbidden" + 429: + $ref: "#/components/responses/TooManyRequests" + /users/{userName}/posts: get: summary: 権限に応じてユーザーの投稿一覧を返す @@ -421,6 +486,36 @@ components: password: type: string + Reaction: + type: object + properties: + reaction: + type: string + + ReactionResponse: + type: object + properties: + reaction: + type: string + isUnicodeEmoji: + type: boolean + iconUrl: + type: string + accounts: + type: array + items: + $ref: "#/components/schemas/Account" + + Account: + type: object + properties: + screenName: + type: string + iconUrl: + type: string + url: + type: string + securitySchemes: BearerAuth: type: http