Skip to content

Commit

Permalink
feat: 質問を削除するためのエントリポイントを定義
Browse files Browse the repository at this point in the history
  • Loading branch information
rito528 committed Aug 17, 2023
1 parent b39fe52 commit d51c247
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
23 changes: 23 additions & 0 deletions schema/paths/forms/questions/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
5 changes: 3 additions & 2 deletions schema/types/forms/components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ components:
description: 質問のID
type: integer
minimum: 0
readOnly: true
example: 0
question_title:
description: 質問のタイトル
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions schema/types/forms/definitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d51c247

Please sign in to comment.