feat: エラーのレスポンス定義を追加

This commit is contained in:
usbharu 2024-02-18 16:29:16 +09:00
parent e21fc00eae
commit 8480d473e6
1 changed files with 96 additions and 0 deletions

View File

@ -250,6 +250,8 @@ paths:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Application" $ref: "#/components/schemas/Application"
422:
$ref: "#/components/responses/unprocessableEntity"
/api/v1/accounts/verify_credentials: /api/v1/accounts/verify_credentials:
get: get:
@ -265,6 +267,12 @@ paths:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/CredentialAccount" $ref: "#/components/schemas/CredentialAccount"
401:
$ref: "#/components/responses/unauthorized"
403:
$ref: "#/components/responses/forbidden"
422:
$ref: "#/components/responses/unprocessableEntity"
/api/v1/accounts: /api/v1/accounts:
post: post:
@ -282,6 +290,10 @@ paths:
responses: responses:
200: 200:
description: 成功 description: 成功
401:
$ref: "#/components/responses/unauthorized"
429:
$ref: "#/components/responses/rateLimited"
/api/v1/accounts/relationships: /api/v1/accounts/relationships:
get: get:
@ -354,6 +366,10 @@ paths:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Account" $ref: "#/components/schemas/Account"
401:
$ref: "#/components/responses/unauthorized"
404:
$ref: "#/components/responses/notfound"
/api/v1/accounts/{id}/follow: /api/v1/accounts/{id}/follow:
post: post:
@ -617,6 +633,11 @@ paths:
items: items:
$ref: "#/components/schemas/Status" $ref: "#/components/schemas/Status"
401:
$ref: "#/components/responses/unauthorized"
404:
$ref: "#/components/responses/notfound"
/api/v1/timelines/public: /api/v1/timelines/public:
get: get:
tags: tags:
@ -2698,6 +2719,81 @@ components:
- created_at - created_at
- account - account
UnprocessableEntityResponse:
type: object
properties:
error:
type: string
UnauthorizedResponse:
type: object
properties:
error:
type: string
default: "The access token is invalid"
required:
- error
RateLimitedResponse:
type: object
properties:
error:
type: string
default: "Too many requests"
required:
- error
ForbiddenResponse:
type: object
properties:
error:
type: string
required:
- error
NotFoundResponse:
type: object
properties:
error:
type: string
required:
- error
responses:
forbidden:
description: forbidden
content:
application/json:
schema:
$ref: "#/components/schemas/ForbiddenResponse"
unprocessableEntity:
description: Unprocessable entity
content:
application/json:
schema:
$ref: "#/components/schemas/UnprocessableEntityResponse"
unauthorized:
description: Unauthorized
content:
application/json:
schema:
$ref: "#/components/schemas/UnauthorizedResponse"
rateLimited:
description: Too many requests
content:
application/json:
schema:
$ref: "#/components/schemas/RateLimitedResponse"
notfound:
description: Not found
content:
application/json:
schema:
$ref: "#/components/schemas/NotFoundResponse"
securitySchemes: securitySchemes:
OAuth2: OAuth2:
type: oauth2 type: oauth2