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

docs: フォームの回答をすべて取得するエントリポイントの定義を追加 #109

Merged
merged 2 commits into from
Sep 13, 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
21 changes: 20 additions & 1 deletion schema/paths/forms/answers/index.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
get:
operationId: getAllAnswers
summary: フォームの回答をすべて取得する
responses:
"200":
description: 指定されたフォームIDの情報取得に成功
content:
application/json:
schema:
$ref: "../../../types/forms/definitions.yml#/definitions/answers"
"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"

post:
operationId: postFormAnswers
summary: 指定フォームに対して回答する
Expand All @@ -7,7 +26,7 @@ post:
content:
application/json:
schema:
$ref: "../../../types/forms/definitions.yml#/definitions/answers"
$ref: "../../../types/forms/definitions.yml#/definitions/batch_answers"
responses:
"200":
description: 回答に成功
Expand Down
12 changes: 10 additions & 2 deletions schema/types/forms/definitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ definitions:
$ref: "./components.yml#/components/schemas/id"
required:
- id
answers:
description: 回答の配列
batch_answers:
description: ひとまとまりの回答
type: object
properties:
uuid:
$ref: "../users/components.yml#/components/schemas/uuid"
Expand All @@ -66,6 +67,13 @@ definitions:
minItems: 0
items:
$ref: "./components.yml#/components/schemas/answer"
answers:
description: batch_answersの配列
type: array
uniqueItems: true
minItems: 0
items:
$ref: "#/definitions/batch_answers"
kind_of_labels:
type: object
properties:
Expand Down