From 594415914328a5d1b233e77fabb0460ad6f9cad4 Mon Sep 17 00:00:00 2001 From: rito528 <39003544+rito528@users.noreply.github.com> Date: Fri, 27 Oct 2023 18:12:51 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=8C=87=E5=AE=9A=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=83=95=E3=82=A9=E3=83=BC=E3=83=A0=E3=81=AE=E8=B3=AA?= =?UTF-8?q?=E5=95=8F=E3=82=92=E5=8F=96=E5=BE=97=E3=81=99=E3=82=8B=E3=82=A8?= =?UTF-8?q?=E3=83=B3=E3=83=89=E3=83=9D=E3=82=A4=E3=83=B3=E3=83=88=E3=81=AE?= =?UTF-8?q?=E5=AE=9A=E7=BE=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- schema/openapi.yml | 6 ++++-- .../paths/forms/[formId]/questions/index.yml | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 schema/paths/forms/[formId]/questions/index.yml diff --git a/schema/openapi.yml b/schema/openapi.yml index 0600493..c757697 100644 --- a/schema/openapi.yml +++ b/schema/openapi.yml @@ -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" diff --git a/schema/paths/forms/[formId]/questions/index.yml b/schema/paths/forms/[formId]/questions/index.yml new file mode 100644 index 0000000..dfb5319 --- /dev/null +++ b/schema/paths/forms/[formId]/questions/index.yml @@ -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" From 425d497bf8db9a319399dce25ae7b53f25b549f9 Mon Sep 17 00:00:00 2001 From: rito528 <39003544+rito528@users.noreply.github.com> Date: Fri, 27 Oct 2023 18:28:05 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20questions=E3=81=ABchoices=E3=81=8C?= =?UTF-8?q?=E6=9B=B8=E3=81=8B=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=8B?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- schema/types/forms/components.yml | 12 ++++++++++++ schema/types/forms/definitions.yml | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/schema/types/forms/components.yml b/schema/types/forms/components.yml index c675a6e..38d7816 100644 --- a/schema/types/forms/components.yml +++ b/schema/types/forms/components.yml @@ -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: | 質問に対する解答を必須にする。 @@ -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: diff --git a/schema/types/forms/definitions.yml b/schema/types/forms/definitions.yml index 44b8460..aba7c2f 100644 --- a/schema/types/forms/definitions.yml +++ b/schema/types/forms/definitions.yml @@ -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: