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: