Skip to content

Commit

Permalink
Merge pull request #109 from GiganticMinecraft/feat/getAllAnswers
Browse files Browse the repository at this point in the history
docs: フォームの回答をすべて取得するエントリポイントの定義を追加
  • Loading branch information
rito528 authored Sep 13, 2023
2 parents 77af1e8 + 0d55777 commit 9e58350
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
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

0 comments on commit 9e58350

Please sign in to comment.