feat: リアクションのAPI定義を追加

This commit is contained in:
usbharu 2023-08-08 16:21:59 +09:00
parent dd06415e09
commit fa6896a124
1 changed files with 95 additions and 0 deletions

View File

@ -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