Skip to content

Commit

Permalink
Merge pull request #128 from GiganticMinecraft/summarizeResponses
Browse files Browse the repository at this point in the history
レスポンス定義を分けずに個々に書く
  • Loading branch information
rito528 authored Dec 15, 2023
2 parents 15b96f8 + 761caa7 commit 8333b07
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 99 deletions.
12 changes: 0 additions & 12 deletions schema/errors/errorResponses.yml

This file was deleted.

10 changes: 5 additions & 5 deletions schema/paths/forms/[formId]/answers/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ get:
schema:
$ref: "../../../../types/forms/definitions.yml#/definitions/answers"
"400":
$ref: "../../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"403":
$ref: "../../../../errors/errorResponses.yml#/components/responses/forbidden"
description: 権限が不足している
"404":
$ref: "../../../../errors/errorResponses.yml#/components/responses/notFound"
description: 指定されたフォームが見つからなかった
"500":
$ref: "../../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー
28 changes: 14 additions & 14 deletions schema/paths/forms/[formId]/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ get:
schema:
$ref: "../../../types/forms/definitions.yml#/definitions/form"
"400":
$ref: "../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"404":
$ref: "../../../errors/errorResponses.yml#/components/responses/notFound"
description: 見つからなかった
"500":
$ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー

delete:
tags:
Expand All @@ -36,15 +36,15 @@ delete:
schema:
$ref: "../../../types/forms/definitions.yml#/definitions/id"
"400":
$ref: "../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"403":
$ref: "../../../errors/errorResponses.yml#/components/responses/forbidden"
description: 権限が不足している
"404":
$ref: "../../../errors/errorResponses.yml#/components/responses/notFound"
description: 見つからなかった
"500":
$ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー

patch:
tags:
Expand All @@ -68,12 +68,12 @@ patch:
schema:
$ref: "../../../types/forms/definitions.yml#/definitions/form"
"400":
$ref: "../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"403":
$ref: "../../../errors/errorResponses.yml#/components/responses/forbidden"
description: 権限が不足している
"404":
$ref: "../../../errors/errorResponses.yml#/components/responses/notFound"
description: 見つからなかった
"500":
$ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー
8 changes: 4 additions & 4 deletions schema/paths/forms/[formId]/questions/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ get:
schema:
$ref: "../../../../types/forms/definitions.yml#/definitions/questions"
"400":
$ref: "../../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"404":
$ref: "../../../../errors/errorResponses.yml#/components/responses/notFound"
description: 指定されたフォームが見つからなかった
"500":
$ref: "../../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー
28 changes: 14 additions & 14 deletions schema/paths/forms/answers/comment/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ post:
"200":
description: コメント成功
"400":
$ref: "../../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"404":
$ref: "../../../../errors/errorResponses.yml#/components/responses/notFound"
description: 回答が見つからなかった
"500":
$ref: "../../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー

delete:
tags:
Expand All @@ -38,15 +38,15 @@ delete:
"200":
description: コメントの削除成功
"400":
$ref: "../../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"403":
$ref: "../../../../errors/errorResponses.yml#/components/responses/forbidden"
description: 権限が不足している
"404":
$ref: "../../../../errors/errorResponses.yml#/components/responses/notFound"
description: コメントIDが見つからなかった
"500":
$ref: "../../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー

patch:
tags:
Expand All @@ -64,12 +64,12 @@ patch:
"200":
description: コメント編集成功
"400":
$ref: "../../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"403":
$ref: "../../../../errors/errorResponses.yml#/components/responses/forbidden"
description: 権限が不足している
"404":
$ref: "../../../../errors/errorResponses.yml#/components/responses/notFound"
description: 見つからなかった
"500":
$ref: "../../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー
18 changes: 9 additions & 9 deletions schema/paths/forms/answers/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ get:
schema:
$ref: "../../../types/forms/definitions.yml#/definitions/answers"
"400":
$ref: "../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"403":
$ref: "../../../errors/errorResponses.yml#/components/responses/forbidden"
description: 権限が不足している
"404":
$ref: "../../../errors/errorResponses.yml#/components/responses/notFound"
description: フォームが見つからなかった
"500":
$ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー

post:
tags:
- forms
operationId: postFormAnswers
summary: 指定フォームに対して回答する
requestBody:
description: 作成するフォームの内容
description: 回答の内容
required: true
content:
application/json:
Expand All @@ -37,8 +37,8 @@ post:
"200":
description: 回答に成功
"401":
$ref: "../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"404":
$ref: "../../../errors/errorResponses.yml#/components/responses/notFound"
description: フォームか質問が見つからなかった
"500":
$ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー
14 changes: 7 additions & 7 deletions schema/paths/forms/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ post:
schema:
type: string
"400":
$ref: "../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"403":
$ref: "../../errors/errorResponses.yml#/components/responses/forbidden"
description: 権限が不足している
"500":
$ref: "../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー
get:
tags:
- forms
Expand Down Expand Up @@ -83,8 +83,8 @@ get:
items:
$ref: "../../types/forms/definitions.yml#/definitions/simple_form"
"400":
$ref: "../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"500":
$ref: "../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー
24 changes: 12 additions & 12 deletions schema/paths/forms/labels/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ get:
schema:
$ref: "../../../types/forms/definitions.yml#/definitions/form_labels"
"400":
$ref: "../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"500":
$ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー

post:
tags:
Expand All @@ -37,13 +37,13 @@ post:
"200":
description: "ラベルの作成に成功"
"400":
$ref: "../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"403":
$ref: "../../../errors/errorResponses.yml#/components/responses/forbidden"
description: 権限が不足している
"401":
$ref: "../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"500":
$ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー

delete:
tags:
Expand All @@ -62,12 +62,12 @@ delete:
"200":
description: "ラベルの削除に成功"
"400":
$ref: "../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"403":
$ref: "../../../errors/errorResponses.yml#/components/responses/forbidden"
description: 権限が不足している
"404":
$ref: "../../../errors/errorResponses.yml#/components/responses/notFound"
description: ラベルIDが見つからなかった
"500":
$ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー
18 changes: 9 additions & 9 deletions schema/paths/forms/questions/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ post:
schema:
$ref: "../../../types/forms/definitions.yml#/definitions/id"
"400":
$ref: "../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"403":
$ref: "../../../errors/errorResponses.yml#/components/responses/forbidden"
description: 権限が不足している
"500":
$ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー

delete:
tags:
Expand All @@ -45,12 +45,12 @@ delete:
"200":
description: "質問の削除に成功"
"400":
$ref: "../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"403":
$ref: "../../../errors/errorResponses.yml#/components/responses/forbidden"
description: 権限が不足している
"404":
$ref: "../../../errors/errorResponses.yml#/components/responses/notFound"
description: question_idが見つからなかった
"500":
$ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー
10 changes: 5 additions & 5 deletions schema/paths/users/[uuid]/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ patch:
"200":
description: ユーザー情報の変更に成功
"400":
$ref: "../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"403":
$ref: "../../../errors/errorResponses.yml#/components/responses/forbidden"
description: 権限が不足している
"404":
$ref: "../../../errors/errorResponses.yml#/components/responses/notFound"
description: ユーザーが見つからなかった
"500":
$ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー
4 changes: 2 additions & 2 deletions schema/paths/users/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ get:
schema:
$ref: "../../types/users/definitions.yml#/definitions/user"
"401":
$ref: "../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"500":
$ref: "../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー
10 changes: 4 additions & 6 deletions schema/paths/users/list/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ get:
schema:
$ref: "../../../types/users/definitions.yml#/definitions/users"
"400":
$ref: "../../../errors/errorResponses.yml#/components/responses/syntaxError"
description: リクエストの構文が間違っている
"401":
$ref: "../../../errors/errorResponses.yml#/components/responses/unauthorized"
description: 認証されていない
"403":
$ref: "../../../errors/errorResponses.yml#/components/responses/forbidden"
"404":
$ref: "../../../errors/errorResponses.yml#/components/responses/notFound"
description: 権限が不足している
"500":
$ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError"
description: サーバーエラー

0 comments on commit 8333b07

Please sign in to comment.