diff --git a/schema/paths/forms/answers/index.yml b/schema/paths/forms/answers/index.yml index adc3e87..f2fef4d 100644 --- a/schema/paths/forms/answers/index.yml +++ b/schema/paths/forms/answers/index.yml @@ -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: 指定フォームに対して回答する @@ -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: 回答に成功 diff --git a/schema/types/forms/definitions.yml b/schema/types/forms/definitions.yml index 0a23f52..4c8eec4 100644 --- a/schema/types/forms/definitions.yml +++ b/schema/types/forms/definitions.yml @@ -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" @@ -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: