From d51c247ec3f261dfabc5dae09439694d08527d74 Mon Sep 17 00:00:00 2001 From: rito528 <39003544+rito528@users.noreply.github.com> Date: Thu, 17 Aug 2023 22:07:25 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B3=AA=E5=95=8F=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4=E3=81=99=E3=82=8B=E3=81=9F=E3=82=81=E3=81=AE=E3=82=A8?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=83=AA=E3=83=9D=E3=82=A4=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E5=AE=9A=E7=BE=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- schema/paths/forms/questions/index.yml | 23 +++++++++++++++++++++++ schema/types/forms/components.yml | 5 +++-- schema/types/forms/definitions.yml | 6 ++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/schema/paths/forms/questions/index.yml b/schema/paths/forms/questions/index.yml index 74ba3eb..90410a6 100644 --- a/schema/paths/forms/questions/index.yml +++ b/schema/paths/forms/questions/index.yml @@ -25,3 +25,26 @@ post: $ref: "../../../errors/errorResponses.yml#/components/responses/forbidden" "500": $ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError" + +delete: + operationId: deleteQuestion + summary: 質問を削除する + description: 作成済みの質問を削除する + requestBody: + description: 削除するフォーム質問ID + required: true + content: + application/json: + schema: + $ref: "../../../types/forms/definitions.yml#/definitions/question_id" + responses: + "200": + description: "質問の削除に成功" + "400": + $ref: "../../../errors/errorResponses.yml#/components/responses/syntaxError" + "401": + $ref: "../../../errors/errorResponses.yml#/components/responses/unauthorized" + "404": + $ref: "../../../errors/errorResponses.yml#/components/responses/notFound" + "500": + $ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError" diff --git a/schema/types/forms/components.yml b/schema/types/forms/components.yml index b9ee56b..fe6c926 100644 --- a/schema/types/forms/components.yml +++ b/schema/types/forms/components.yml @@ -63,7 +63,6 @@ components: description: 質問のID type: integer minimum: 0 - readOnly: true example: 0 question_title: description: 質問のタイトル @@ -99,7 +98,9 @@ components: type: object properties: question_id: - $ref: "#/components/schemas/question_id" + readOnly: true + allOf: + - $ref: "#/components/schemas/question_id" question_title: $ref: "#/components/schemas/question_title" question_description: diff --git a/schema/types/forms/definitions.yml b/schema/types/forms/definitions.yml index 5e648cb..996c6a7 100644 --- a/schema/types/forms/definitions.yml +++ b/schema/types/forms/definitions.yml @@ -32,6 +32,12 @@ definitions: properties: questions: $ref: "./components.yml#/components/schemas/questions" + question_id: + description: 質問のID + type: object + properties: + question_id: + $ref: "./components.yml#/components/schemas/question_id" id: type: object properties: