Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

フォームの質問を取得するエンドポイントの定義 #117

Merged
merged 2 commits into from
Oct 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions schema/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ paths:
$ref: "./paths/forms/index.yml"
/forms/{formId}:
$ref: "./paths/forms/[formId]/index.yml"
/forms/{formId}/questions:
$ref: "./paths/forms/[formId]/questions/index.yml"
/forms/{formId}/answers:
$ref: "./paths/forms/[formId]/answers/index.yml"
/forms/questions:
$ref: "./paths/forms/questions/index.yml"
/forms/answers:
$ref: "./paths/forms/answers/index.yml"
/forms/answers/comment:
$ref: "./paths/forms/answers/comment/index.yml"
/forms/{formId}/answers:
$ref: "./paths/forms/[formId]/answers/index.yml"
/forms/labels:
$ref: "./paths/forms/labels/index.yml"
21 changes: 21 additions & 0 deletions schema/paths/forms/[formId]/questions/index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
get:
operationId: getQuestions
summary: 質問の取得
description: 指定したフォームの質問をすべて取得します。
parameters:
- $ref: "../../../../types/forms/parameters.yml#/parameters/id"
responses:
"200":
description: 指定されたフォームの回答の取得に成功
content:
application/json:
schema:
$ref: "../../../../types/forms/definitions.yml#/definitions/questions"
"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"
12 changes: 12 additions & 0 deletions schema/types/forms/components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ components:
- MULTIPLE
- SINGLE
example: TEXT
question_choices:
description: |
質問の選択肢の配列。
TEXT以外の場合は指定必須。
type: array
uniqueItems: true
minItems: 1
items:
type: string
example: []
is_required:
description: |
質問に対する解答を必須にする。
Expand All @@ -115,6 +125,8 @@ components:
$ref: "#/components/schemas/question_description"
question_type:
$ref: "#/components/schemas/question_type"
choices:
$ref: "#/components/schemas/question_choices"
is_required:
$ref: "#/components/schemas/is_required"
questions:
Expand Down
4 changes: 3 additions & 1 deletion schema/types/forms/definitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ definitions:
type: object
properties:
form_id:
$ref: "./components.yml#/components/schemas/id"
writeOnly: true
allOf:
- $ref: "./components.yml#/components/schemas/id"
questions:
$ref: "./components.yml#/components/schemas/questions"
question_id:
Expand Down