From b77a5ca905f790a31d698ec3632d0f53450f9468 Mon Sep 17 00:00:00 2001 From: rei Date: Tue, 5 Dec 2023 22:12:04 +0900 Subject: [PATCH 01/43] =?UTF-8?q?=E3=82=B9=E3=83=9A=E3=83=AB=E3=83=9F?= =?UTF-8?q?=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 418 +++++++++++++++++++------------------- 1 file changed, 209 insertions(+), 209 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index e00c0971..ef313687 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -1,8 +1,8 @@ openapi: 3.0.0 servers: - - url: 'https://anke-to.trap.jp/api' + - url: "https://anke-to.trap.jp/api" description: production - - url: 'http://localhost:8080/api' + - url: "http://localhost:8080/api" description: local info: title: anke-to API @@ -10,7 +10,7 @@ info: description: anke-to API contact: name: traP - url: 'https://github.com/traPtitech/anke-to' + url: "https://github.com/traPtitech/anke-to" security: - application: - read @@ -30,22 +30,22 @@ paths: - questionnaire description: 与えられた条件を満たす20件以下のアンケートのリストを取得します. parameters: - - $ref: '#/components/parameters/sortInQuery' - - $ref: '#/components/parameters/searchInQuery' - - $ref: '#/components/parameters/pageInQuery' - - $ref: '#/components/parameters/nontargetedInQuery' + - $ref: "#/components/parameters/sortInQuery" + - $ref: "#/components/parameters/searchInQuery" + - $ref: "#/components/parameters/pageInQuery" + - $ref: "#/components/parameters/nontargetedInQuery" responses: - '200': + "200": description: 正常に取得できました。アンケートの配列を返します。 content: application/json: schema: - $ref: '#/components/schemas/QuestionnairesWithPageMax' - '400': + $ref: "#/components/schemas/QuestionnairesWithPageMax" + "400": description: 与えられた情報の形式が異なります - '500': + "500": description: アンケートを正常に取得できませんでした - '503': + "503": description: SQLの実行時間が3sを超えた場合。主に正規表現が原因。 post: operationId: postQuestionnaire @@ -57,39 +57,39 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/NewQuestionnaire' + $ref: "#/components/schemas/NewQuestionnaire" responses: - '201': + "201": description: 正常にアンケートを作成できました.作成されたアンケートを返します. content: application/json: schema: - $ref: '#/components/schemas/NewQuestionnaireResponse' - '400': + $ref: "#/components/schemas/NewQuestionnaireResponse" + "400": description: 与えられた情報の形式が異なります - '500': + "500": description: アンケートを正常に作成できませんでした - '/questionnaires/{questionnaireID}': + "/questionnaires/{questionnaireID}": get: operationId: getQuestionnaire tags: - questionnaire description: アンケートの情報を取得します。 parameters: - - $ref: '#/components/parameters/questionnaireIDInPath' + - $ref: "#/components/parameters/questionnaireIDInPath" responses: - '200': + "200": description: 正常に取得できました。 content: application/json: schema: - $ref: '#/components/schemas/QuestionnaireByID' - '400': + $ref: "#/components/schemas/QuestionnaireByID" + "400": description: アンケートのIDが無効です - '404': + "404": description: アンケートが存在しません - '500': + "500": description: アンケートを正常に取得できませんでした patch: operationId: editQuestionnaire @@ -97,99 +97,99 @@ paths: - questionnaire description: アンケートの情報を変更します. parameters: - - $ref: '#/components/parameters/questionnaireIDInPath' + - $ref: "#/components/parameters/questionnaireIDInPath" requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/NewQuestionnaire' + $ref: "#/components/schemas/NewQuestionnaire" responses: - '200': + "200": description: 正常にアンケートを変更できました. - '400': + "400": description: アンケートのIDが無効です - '500': + "500": description: 正常にアンケートを変更できませんでした delete: - operationId: delteQuestionnaire + operationId: deleteQuestionnaire tags: - questionnaire description: アンケートを削除します. parameters: - - $ref: '#/components/parameters/questionnaireIDInPath' + - $ref: "#/components/parameters/questionnaireIDInPath" responses: - '200': + "200": description: 正常にアンケートを削除できました. - '400': + "400": description: アンケートのIDが無効です - '500': + "500": description: アンケートの削除ができませんでした - '/questionnaires/{questionnaireID}/questions': + "/questionnaires/{questionnaireID}/questions": get: operationId: getQuestions tags: - questionnaire description: アンケートに含まれる質問のリストを取得します。 parameters: - - $ref: '#/components/parameters/questionnaireIDInPath' + - $ref: "#/components/parameters/questionnaireIDInPath" responses: - '200': + "200": description: 正常に取得できました。 content: application/json: schema: type: array items: - $ref: '#/components/schemas/QuestionDetails' - '400': + $ref: "#/components/schemas/QuestionDetails" + "400": description: アンケートのIDが無効です - '500': + "500": description: 質問のリストを取得できませんでした post: operationId: PostQuestionByQuestionnaireID tags: - questionnaire parameters: - - $ref: '#/components/parameters/questionnaireIDInPath' + - $ref: "#/components/parameters/questionnaireIDInPath" description: 新しい質問を作成します. requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/NewQuestion' + $ref: "#/components/schemas/NewQuestion" responses: - '201': + "201": description: 正常に質問を作成できました.作成された質問を返します. content: application/json: schema: - $ref: '#/components/schemas/Question' - '400': + $ref: "#/components/schemas/Question" + "400": description: 正常に作成できませんでした。リクエストが不正です。 - '500': + "500": description: 正常に作成できません。主に正規表現が原因。 - '/questions/{questionID}': + "/questions/{questionID}": patch: operationId: editQuestion tags: - question description: 質問を変更します. parameters: - - $ref: '#/components/parameters/questionIDInPath' + - $ref: "#/components/parameters/questionIDInPath" requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/NewQuestion' + $ref: "#/components/schemas/NewQuestion" responses: - '200': + "200": description: 正常に質問を変更できました. - '400': + "400": description: 正常に変更できませんでした。リクエストが不正です。 - '500': + "500": description: 正常に変更できませんでした。主に正規表現が原因。 delete: operationId: deleteQuestion @@ -197,11 +197,11 @@ paths: - question description: 質問を削除します. parameters: - - $ref: '#/components/parameters/questionIDInPath' + - $ref: "#/components/parameters/questionIDInPath" responses: - '200': + "200": description: 正常に質問を削除できました。 - '500': + "500": description: 正常に削除できませんでした。存在しない質問です。 /responses: post: @@ -214,42 +214,42 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PostResponse' + $ref: "#/components/schemas/PostResponse" responses: - '201': + "201": description: 正常に回答を作成できました.作成された回答を返します. content: application/json: schema: - $ref: '#/components/schemas/ResponseDetails' - '400': + $ref: "#/components/schemas/ResponseDetails" + "400": description: 与えられた情報の形式が異なります - '404': + "404": description: アンケートの回答の期限がきれたため回答が存在しません - '405': + "405": description: 回答期限が過ぎたため回答できません - '500': + "500": description: 正常に回答が作成できませんでした - '/responses/{responseID}': + "/responses/{responseID}": get: operationId: getResponses tags: - response description: あるresponseIDを持つ回答に含まれる全ての質問に対する自分の回答を取得します parameters: - - $ref: '#/components/parameters/responseIDInPath' + - $ref: "#/components/parameters/responseIDInPath" responses: - '200': + "200": description: 正常に取得できました。 content: application/json: schema: - $ref: '#/components/schemas/Response' - '400': + $ref: "#/components/schemas/Response" + "400": description: responseIDが数値に変換できませんでした - '404': + "404": description: アンケートの回答の期限がきれたため回答が存在しません - '500': + "500": description: responseIDを取得できませんでした patch: operationId: editResponse @@ -257,23 +257,23 @@ paths: - response description: 回答を変更します. parameters: - - $ref: '#/components/parameters/responseIDInPath' + - $ref: "#/components/parameters/responseIDInPath" requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/NewResponse' + $ref: "#/components/schemas/NewResponse" responses: - '200': + "200": description: 正常に回答を変更できました. - '400': + "400": description: 与えられた回答の情報が異なります - '404': + "404": description: アンケートの回答の期限がきれたため回答が存在しません - '405': + "405": description: 回答期限が過ぎたため回答できません - '500': + "500": description: responseIDを取得できませんでした delete: operationId: deleteResponse @@ -281,17 +281,17 @@ paths: - response description: 回答を削除します. parameters: - - $ref: '#/components/parameters/responseIDInPath' + - $ref: "#/components/parameters/responseIDInPath" responses: - '200': + "200": description: 正常に回答を削除できました. - '400': + "400": description: 与えられた回答の情報が異なります - '404': + "404": description: アンケートの回答の期限がきれたため回答が存在しません - '405': + "405": description: 回答期限が過ぎたため回答できません - '500': + "500": description: responseIDを取得できませんでした /users: get: @@ -301,14 +301,14 @@ paths: summary: 未実装 description: (botおよび除名されたユーザーを除く、全ての) ユーザーのtraQIDのリストを取得します。 responses: - '200': + "200": description: 正常に取得できました.ユーザーの配列を返します. content: application/json: schema: type: array items: - $ref: '#/components/schemas/User' + $ref: "#/components/schemas/User" /users/me: get: operationId: getUsersMe @@ -316,13 +316,13 @@ paths: - user description: 自分のユーザー情報を取得します responses: - '200': + "200": description: 正常に取得できました。 content: application/json: schema: - $ref: '#/components/schemas/Me' - '500': + $ref: "#/components/schemas/Me" + "500": description: Userが取得できませんでした /users/me/responses: get: @@ -331,36 +331,36 @@ paths: - user description: 自分のすべての回答のリストを取得します。 responses: - '200': + "200": description: 正常に取得できました。回答の配列を返します。 content: application/json: schema: type: array items: - $ref: '#/components/schemas/ResponseSummary' - '500': + $ref: "#/components/schemas/ResponseSummary" + "500": description: Userが取得できませんでした - '/users/me/responses/{questionnaireID}': + "/users/me/responses/{questionnaireID}": get: operationId: getMyResponsesByID tags: - user parameters: - - $ref: '#/components/parameters/questionnaireIDInPath' + - $ref: "#/components/parameters/questionnaireIDInPath" description: 特定のquestionnaireIdを持つアンケートに対する自分のすべての回答のリストを取得します。 responses: - '200': + "200": description: 正常に取得できました。回答の配列を返します。 content: application/json: schema: type: array items: - $ref: '#/components/schemas/ResponseSummary' - '400': + $ref: "#/components/schemas/ResponseSummary" + "400": description: questionnaireIDの型が数値ではありません - '500': + "500": description: 回答のリストを取得できませんでした /users/me/targeted: get: @@ -369,40 +369,40 @@ paths: - user description: 自分が対象になっている アンケートのリストを取得します。 parameters: - - $ref: '#/components/parameters/sortInQuery' + - $ref: "#/components/parameters/sortInQuery" responses: - '200': + "200": description: 正常に取得できました。アンケートの配列を返します。 content: application/json: schema: type: array items: - $ref: '#/components/schemas/QuestionnaireMyTargeted' - '500': + $ref: "#/components/schemas/QuestionnaireMyTargeted" + "500": description: 自分のUserIDが取得できませんでした /users/{traQID}/targeted: get: - operationId: getTargettedQuestionnairesBytraQID + operationId: getTargetedQuestionnairesBytraQID tags: - user description: ユーザが対象になっているアンケートのリストを取得します。 parameters: - - $ref: '#/components/parameters/sortInQuery' - - $ref: '#/components/parameters/answeredInQuery' - - $ref: '#/components/parameters/traQIDInPath' + - $ref: "#/components/parameters/sortInQuery" + - $ref: "#/components/parameters/answeredInQuery" + - $ref: "#/components/parameters/traQIDInPath" responses: - '200': + "200": description: 正常に取得できました。アンケートの配列を返します。 content: application/json: schema: type: array items: - $ref: '#/components/schemas/QuestionnaireMyTargeted' - '400': + $ref: "#/components/schemas/QuestionnaireMyTargeted" + "400": description: 与えらえた情報の形式が異なります - '500': + "500": description: 対象となっているアンケートのリストを取得できませんでした /users/me/administrates: get: @@ -411,15 +411,15 @@ paths: - user description: 自分が管理者になっているアンケートのリストを取得します。 responses: - '200': + "200": description: 正常に取得できました。アンケートの配列を返します。 content: application/json: schema: type: array items: - $ref: '#/components/schemas/QuestionnaireMyAdministrates' - '500': + $ref: "#/components/schemas/QuestionnaireMyAdministrates" + "500": description: 自分が管理者となっているアンケートのリストを取得できませんでした /groups: get: @@ -429,37 +429,37 @@ paths: summary: 未実装 description: (全ての) グループのリストを取得します responses: - '200': + "200": description: 正常に取得できました.グループの配列を返します. content: application/json: schema: type: array items: - $ref: '#/components/schemas/Group' - '/results/{questionnaireID}': + $ref: "#/components/schemas/Group" + "/results/{questionnaireID}": get: operationId: getResults tags: - result parameters: - - $ref: '#/components/parameters/questionnaireIDInPath' - - $ref: '#/components/parameters/responseSortInQuery' + - $ref: "#/components/parameters/questionnaireIDInPath" + - $ref: "#/components/parameters/responseSortInQuery" description: あるquestionnaireIDを持つアンケートの結果をすべて取得します。 responses: - '200': + "200": description: 正常に取得できました。アンケートの各質問に対する結果の配列を返します。 content: application/json: schema: type: array items: - $ref: '#/components/schemas/ResponseResult' - '400': + $ref: "#/components/schemas/ResponseResult" + "400": description: questionnaireIDの型を数値に変換できませんでした - '403': + "403": description: 結果を閲覧する権限がありません。 - '500': + "500": description: アンケートの回答の詳細情報一覧が取得できませんでした components: parameters: @@ -468,7 +468,7 @@ components: in: query description: 回答したもの(answered)か未回答のもの(unanswered)かを選別 schema: - $ref: '#/components/schemas/AnsweredType' + $ref: "#/components/schemas/AnsweredType" sortInQuery: name: sort in: query @@ -477,7 +477,7 @@ components: タイトルの降順 "-title", 更新日時が新しい "modified_at", 更新日時が古い "-modified_at" ) schema: - $ref: '#/components/schemas/SortType' + $ref: "#/components/schemas/SortType" responseSortInQuery: name: sort in: query @@ -486,7 +486,7 @@ components: タイトルの降順 "-title", 更新日時が新しい "modified_at", 更新日時が古い "-modified_at" ) schema: - $ref: '#/components/schemas/ResponseSortType' + $ref: "#/components/schemas/ResponseSortType" searchInQuery: name: search in: query @@ -604,11 +604,11 @@ components: type: string format: date-time res_shared_to: - $ref: '#/components/schemas/ResShareType' + $ref: "#/components/schemas/ResShareType" targets: - $ref: '#/components/schemas/Users' + $ref: "#/components/schemas/Users" administrators: - $ref: '#/components/schemas/Users' + $ref: "#/components/schemas/Users" required: - title - description @@ -618,7 +618,7 @@ components: - administrators NewQuestionnaireResponse: allOf: - - $ref: '#/components/schemas/QuestionnaireUser' + - $ref: "#/components/schemas/QuestionnaireUser" Questionnaire: type: object properties: @@ -641,7 +641,7 @@ components: type: string format: date-time res_shared_to: - $ref: '#/components/schemas/ResShareType' + $ref: "#/components/schemas/ResShareType" required: - questionnaireID - title @@ -653,7 +653,7 @@ components: - targets QuestionnaireForList: allOf: - - $ref: '#/components/schemas/Questionnaire' + - $ref: "#/components/schemas/Questionnaire" - type: object properties: is_targeted: @@ -672,36 +672,36 @@ components: questionnaires: type: array items: - $ref: '#/components/schemas/QuestionnaireForList' + $ref: "#/components/schemas/QuestionnaireForList" required: - page_max - questionnaires QuestionnaireByID: allOf: - - $ref: '#/components/schemas/QuestionnaireUser' + - $ref: "#/components/schemas/QuestionnaireUser" - type: object properties: respondents: - $ref: '#/components/schemas/Users' + $ref: "#/components/schemas/Users" required: - respondents QuestionnaireMyTargeted: allOf: - - $ref: '#/components/schemas/Questionnaire' - - type: object - properties: - responded_at: - type: string - format: date-time - has_response: - type: boolean - description: 回答済みあるいは下書きが存在する - required: - - responded_at - - has_response + - $ref: "#/components/schemas/Questionnaire" + - type: object + properties: + responded_at: + type: string + format: date-time + has_response: + type: boolean + description: 回答済みあるいは下書きが存在する + required: + - responded_at + - has_response QuestionnaireMyAdministrates: - allOf: - - $ref: '#/components/schemas/QuestionnaireUser' + allOf: + - $ref: "#/components/schemas/QuestionnaireUser" - type: object properties: all_responded: @@ -710,22 +710,22 @@ components: description: | 回答必須でない場合、またはすべてのターゲットが回答済みの場合、true を返す。それ以外はfalseを返す。 respondents: - $ref: '#/components/schemas/Users' + $ref: "#/components/schemas/Users" required: - all_responded - respondents QuestionnaireUser: allOf: - - $ref: '#/components/schemas/Questionnaire' - - type: object - properties: - targets: - $ref: '#/components/schemas/Users' - administrators: - $ref: '#/components/schemas/Users' - required: - - targets - - administrators + - $ref: "#/components/schemas/Questionnaire" + - type: object + properties: + targets: + $ref: "#/components/schemas/Users" + administrators: + $ref: "#/components/schemas/Users" + required: + - targets + - administrators QuestionType: type: string example: Text @@ -752,7 +752,7 @@ components: description: | アンケートの質問のうち、何問目か question_type: - $ref: '#/components/schemas/QuestionType' + $ref: "#/components/schemas/QuestionType" body: type: string example: 質問文 @@ -780,13 +780,13 @@ components: example: 5 regex_pattern: type: string - example: '' + example: "" min_bound: type: string - example: '' + example: "" max_bound: type: string - example: '' + example: "" required: - page_num - question_num @@ -800,38 +800,38 @@ components: - scale_max NewQuestion: allOf: - - $ref: '#/components/schemas/QuestionBase' - - type: object - properties: - questionnaireID: - type: integer - example: 1 - required: - - questionnaireID + - $ref: "#/components/schemas/QuestionBase" + - type: object + properties: + questionnaireID: + type: integer + example: 1 + required: + - questionnaireID Question: allOf: - - $ref: '#/components/schemas/NewQuestion' - - type: object - properties: - questionID: - type: integer - example: 1 - required: - - questionID + - $ref: "#/components/schemas/NewQuestion" + - type: object + properties: + questionID: + type: integer + example: 1 + required: + - questionID QuestionDetails: allOf: - - $ref: '#/components/schemas/QuestionBase' - - type: object - properties: - questionID: - type: integer - example: 1 - created_at: - type: string - format: date-time - required: - - questionID - - created_at + - $ref: "#/components/schemas/QuestionBase" + - type: object + properties: + questionID: + type: integer + example: 1 + created_at: + type: string + format: date-time + required: + - questionID + - created_at NewResponse: type: object properties: @@ -841,7 +841,7 @@ components: body: type: array items: - $ref: '#/components/schemas/ResponseBody' + $ref: "#/components/schemas/ResponseBody" submitted_at: type: string format: date-time @@ -858,7 +858,7 @@ components: body: type: array items: - $ref: '#/components/schemas/ResponseBody' + $ref: "#/components/schemas/ResponseBody" temporarily: type: boolean example: true @@ -871,7 +871,7 @@ components: - body Response: allOf: - - $ref: '#/components/schemas/NewResponse' + - $ref: "#/components/schemas/NewResponse" - type: object properties: modified_at: @@ -881,7 +881,7 @@ components: - modified_at ResponseDetails: allOf: - - $ref: '#/components/schemas/NewResponse' + - $ref: "#/components/schemas/NewResponse" - type: object properties: responseID: @@ -925,7 +925,7 @@ components: type: integer example: 1 question_type: - $ref: '#/components/schemas/QuestionType' + $ref: "#/components/schemas/QuestionType" response: type: string example: リマインダーBOTを作った話 @@ -939,18 +939,18 @@ components: - question_type ResponseResult: allOf: - - $ref: '#/components/schemas/Response' - - type: object - properties: - traqID: - type: string - example: lolico - responseID: - type: integer - example: 1 - required: - - traqID - - responseID + - $ref: "#/components/schemas/Response" + - type: object + properties: + traqID: + type: string + example: lolico + responseID: + type: integer + example: 1 + required: + - traqID + - responseID required: - submitted_at Users: @@ -1008,7 +1008,7 @@ components: members: type: array items: - $ref: '#/components/schemas/Users' + $ref: "#/components/schemas/Users" createdAt: type: string format: date-time @@ -1028,7 +1028,7 @@ components: type: oauth2 flows: clientCredentials: - tokenUrl: 'http://example.com/oauth/token' + tokenUrl: "http://example.com/oauth/token" scopes: write: allows modifying resources read: allows reading resources From 83f4173723f5d4bf27a7d169aa0626ccf5d400ae Mon Sep 17 00:00:00 2001 From: rei Date: Fri, 8 Dec 2023 11:07:23 +0900 Subject: [PATCH 02/43] =?UTF-8?q?=E5=90=84properties=E3=82=92=E5=94=AF?= =?UTF-8?q?=E4=B8=80=E3=81=AE=E8=A6=81=E7=B4=A0=E3=81=AB=E3=82=82=E3=81=A4?= =?UTF-8?q?schema=E3=82=92=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 142 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 137 insertions(+), 5 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index ef313687..9b6a6251 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -953,11 +953,6 @@ components: - responseID required: - submitted_at - Users: - type: array - items: - type: string - example: lolico User: type: object properties: @@ -1023,6 +1018,143 @@ components: - members - createdAt - updatedAt + QuestionnaireID: + type: object + properties: + questionnaireID: + type: integer + example: 1 + required: + - questionnaireID + QuestionnaireTitle: + type: object + properties: + title: + type: string + example: 第1回集会らん☆ぷろ募集アンケート + required: + - title + QuestionnaireDescription: + type: object + properties: + description: + type: string + example: 第1回メンバー集会でのらん☆ぷろで発表したい人を募集します らん☆ぷろで発表したい人あつまれー! + required: + - description + QuestionnaireResponseDueDateTime: + type: object + properties: + response_due_date_time: + type: string + format: date-time + required: + - response_due_date_time + QuestionnaireResponseViewableBy: + type: object + properties: + response_viewable_by: + $ref: "#/components/schemas/ResShareType" + required: + - response_viewable_by + QuestionnaireIsAnonymous: + type: object + properties: + is_anonymous: + type: boolean + example: true + description: | + 匿名回答かどうか + required: + - is_anonymous + QuestionnaireAllowsMultipleResponses: + type: object + properties: + allows_multiple_responses: + type: boolean + example: true + description: | + 一人が複数回回答できるかどうか + required: + - allows_multiple_responses + QuestionnaireIsPublished: + type: object + properties: + is_published: + type: boolean + example: true + description: | + アンケートが公開されているかどうか + required: + - is_published + QuestionnaireCreatedAt: + type: object + properties: + created_at: + type: string + format: date-time + required: + - created_at + QuestionnaireModifiedAt: + type: object + properties: + modified_at: + type: string + format: date-time + required: + - modified_at + QuestionnaireTargets: + $ref: "#/components/schemas/UsersAndGroups" + QuestionnaireAdministrators: + $ref: "#/components/schemas/UsersAndGroups" + QuestionnaireAllResponded: + type: object + properties: + all_responded: + type: boolean + example: true + description: | + 回答必須でない場合、またはすべてのターゲットが回答済みの場合、true を返す。それ以外はfalseを返す。 + required: + - all_responded + QuestionnaireRespondents: + $ref: "#/components/schemas/Users" + QuestionnaireRespondedAt: + type: object + properties: + responded_at: + type: string + format: date-time + required: + - responded_at + QuestionnaireHasMyResponse: + type: object + properties: + has_response: + type: boolean + description: 回答済みあるいは下書きが存在する + required: + - has_response + UsersAndGroups: + type: object + properties: + users: + $ref: "#/components/schemas/Users" + groups: + $ref: "#/components/schemas/Groups" + required: + - users + - groups + Users: + type: array + items: + type: string + example: cp20 + Groups: + type: array + items: + type: string + example: executive24 securitySchemes: application: type: oauth2 From c911cf7bbfadb287f6839b3e498fbd08b4f57252 Mon Sep 17 00:00:00 2001 From: rei Date: Fri, 8 Dec 2023 11:16:01 +0900 Subject: [PATCH 03/43] =?UTF-8?q?NewQuestionnaire,=20NewQuestionnaireRespo?= =?UTF-8?q?nse=E3=82=92=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 46 ++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 9b6a6251..3916448c 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -592,33 +592,22 @@ components: description: | アンケートの結果を, 運営は見られる ("administrators"), 回答済みの人は見られる ("respondents") 誰でも見られる ("public") NewQuestionnaire: - type: object - properties: - title: - type: string - example: 第1回集会らん☆ぷろ募集アンケート - description: - type: string - example: 第1回メンバー集会でのらん☆ぷろで発表したい人を募集します らん☆ぷろで発表したい人あつまれー! - res_time_limit: - type: string - format: date-time - res_shared_to: - $ref: "#/components/schemas/ResShareType" - targets: - $ref: "#/components/schemas/Users" - administrators: - $ref: "#/components/schemas/Users" - required: - - title - - description - - res_time_limit - - res_shared_to - - targets - - administrators + allOf: + - $ref: "#/components/schemas/QuestionnaireTitle" + - $ref: "#/components/schemas/QuestionnaireDescription" + - $ref: "#/components/schemas/QuestionnaireResponseDueDateTime" + - $ref: "#/components/schemas/QuestionnaireResponseViewableBy" + - $ref: "#/components/schemas/QuestionnaireIsAnonymous" + - $ref: "#/components/schemas/QuestionnaireAllowsMultipleResponses" + - $ref: "#/components/schemas/QuestionnaireIsPublished" + - $ref: "#/components/schemas/QuestionnaireTargets" + - $ref: "#/components/schemas/QuestionnaireAdministrators" + - $ref: "#/components/schemas/QuestionnaireQuestions" NewQuestionnaireResponse: allOf: - - $ref: "#/components/schemas/QuestionnaireUser" + - $ref: "#/components/schemas/Questionnaire" + - $ref: "#/components/schemas/QuestionnaireCreatedAt" + - $ref: "#/components/schemas/QuestionnaireModifiedAt" Questionnaire: type: object properties: @@ -1135,6 +1124,13 @@ components: description: 回答済みあるいは下書きが存在する required: - has_response + QuestionnaireQuestions: + type: object + properties: + questions: + type: array + items: + $ref: "#/components/schemas/Question" UsersAndGroups: type: object properties: From 918893c0f725d902c44081de4772ddcec4ecd7ff Mon Sep 17 00:00:00 2001 From: rei Date: Fri, 8 Dec 2023 12:03:53 +0900 Subject: [PATCH 04/43] =?UTF-8?q?=E5=90=84schema=E3=82=92=E4=BD=9C?= =?UTF-8?q?=E6=88=90=E3=83=BB=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 75 +++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 43 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 3916448c..ac9b8817 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -591,6 +591,24 @@ components: - public description: | アンケートの結果を, 運営は見られる ("administrators"), 回答済みの人は見られる ("respondents") 誰でも見られる ("public") + QuestionnaireSummary: + allOf: + - $ref: "#/components/schemas/QuestionnaireID" + - $ref: "#/components/schemas/QuestionnaireTitle" + - $ref: "#/components/schemas/QuestionnaireDescription" + - $ref: "#/components/schemas/QuestionnaireResponseDueDateTime" + - $ref: "#/components/schemas/QuestionnaireResponseViewableBy" + - $ref: "#/components/schemas/QuestionnaireIsAnonymous" + - $ref: "#/components/schemas/QuestionnaireAllowsMultipleResponses" + - $ref: "#/components/schemas/QuestionnaireIsPublished" + - $ref: "#/components/schemas/QuestionnaireTargets" + - $ref: "#/components/schemas/QuestionnaireAdministrators" + QuestionnaireDetail: + allOf: + - $ref: "#/components/schemas/QuestionnaireID" + - $ref: "#/components/schemas/Questionnaire" + - $ref: "#/components/schemas/QuestionnaireCreatedAt" + - $ref: "#/components/schemas/QuestionnaireModifiedAt" NewQuestionnaire: allOf: - $ref: "#/components/schemas/QuestionnaireTitle" @@ -605,41 +623,21 @@ components: - $ref: "#/components/schemas/QuestionnaireQuestions" NewQuestionnaireResponse: allOf: + - $ref: "#/components/schemas/QuestionnaireID" - $ref: "#/components/schemas/Questionnaire" - $ref: "#/components/schemas/QuestionnaireCreatedAt" - $ref: "#/components/schemas/QuestionnaireModifiedAt" Questionnaire: - type: object - properties: - questionnaireID: - type: integer - example: 1 - title: - type: string - example: 第1回集会らん☆ぷろ募集アンケート - description: - type: string - example: 第1回メンバー集会でのらん☆ぷろで発表したい人を募集します らん☆ぷろで発表したい人あつまれー! - res_time_limit: - type: string - format: date-time - created_at: - type: string - format: date-time - modified_at: - type: string - format: date-time - res_shared_to: - $ref: "#/components/schemas/ResShareType" - required: - - questionnaireID - - title - - description - - res_time_limit - - created_at - - modified_at - - res_shared_to - - targets + allOf: + - $ref: "#/components/schemas/QuestionnaireID" + - $ref: "#/components/schemas/QuestionnaireTitle" + - $ref: "#/components/schemas/QuestionnaireDescription" + - $ref: "#/components/schemas/QuestionnaireResponseDueDateTime" + - $ref: "#/components/schemas/QuestionnaireResponseViewableBy" + - $ref: "#/components/schemas/QuestionnaireIsAnonymous" + - $ref: "#/components/schemas/QuestionnaireAllowsMultipleResponses" + - $ref: "#/components/schemas/QuestionnaireIsPublished" + - $ref: "#/components/schemas/QuestionnaireQuestions" QuestionnaireForList: allOf: - $ref: "#/components/schemas/Questionnaire" @@ -667,7 +665,7 @@ components: - questionnaires QuestionnaireByID: allOf: - - $ref: "#/components/schemas/QuestionnaireUser" + - $ref: "#/components/schemas/NewQuestionnaireResponse" - type: object properties: respondents: @@ -690,7 +688,7 @@ components: - has_response QuestionnaireMyAdministrates: allOf: - - $ref: "#/components/schemas/QuestionnaireUser" + - $ref: "#/components/schemas/NewQuestionnaireResponse" - type: object properties: all_responded: @@ -705,16 +703,7 @@ components: - respondents QuestionnaireUser: allOf: - - $ref: "#/components/schemas/Questionnaire" - - type: object - properties: - targets: - $ref: "#/components/schemas/Users" - administrators: - $ref: "#/components/schemas/Users" - required: - - targets - - administrators + - $ref: "#/components/schemas/NewQuestionnaireResponse" QuestionType: type: string example: Text From 0715cc10998baaf6813c5fe8d85d9b90c711b1e2 Mon Sep 17 00:00:00 2001 From: rei Date: Fri, 8 Dec 2023 18:34:28 +0900 Subject: [PATCH 05/43] =?UTF-8?q?parameter=E3=81=A8schema=E3=82=92?= =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 41 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index ac9b8817..ef1d33b4 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -33,7 +33,7 @@ paths: - $ref: "#/components/parameters/sortInQuery" - $ref: "#/components/parameters/searchInQuery" - $ref: "#/components/parameters/pageInQuery" - - $ref: "#/components/parameters/nontargetedInQuery" + - $ref: "#/components/parameters/isTargetingMeInQuery" responses: "200": description: 正常に取得できました。アンケートの配列を返します。 @@ -64,7 +64,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/NewQuestionnaireResponse" + $ref: "#/components/schemas/QuestionnaireDetail" "400": description: 与えられた情報の形式が異なります "500": @@ -499,8 +499,8 @@ components: description: 何ページ目か (未定義の場合は1ページ目) schema: type: integer - nontargetedInQuery: - name: nontargeted + isTargetingMeInQuery: + name: isTargetingMe in: query description: | 自分がターゲットになっていないもののみ取得 (true), ターゲットになっているものも含めてすべて取得 (false)。デフォルトはfalse。 @@ -591,24 +591,6 @@ components: - public description: | アンケートの結果を, 運営は見られる ("administrators"), 回答済みの人は見られる ("respondents") 誰でも見られる ("public") - QuestionnaireSummary: - allOf: - - $ref: "#/components/schemas/QuestionnaireID" - - $ref: "#/components/schemas/QuestionnaireTitle" - - $ref: "#/components/schemas/QuestionnaireDescription" - - $ref: "#/components/schemas/QuestionnaireResponseDueDateTime" - - $ref: "#/components/schemas/QuestionnaireResponseViewableBy" - - $ref: "#/components/schemas/QuestionnaireIsAnonymous" - - $ref: "#/components/schemas/QuestionnaireAllowsMultipleResponses" - - $ref: "#/components/schemas/QuestionnaireIsPublished" - - $ref: "#/components/schemas/QuestionnaireTargets" - - $ref: "#/components/schemas/QuestionnaireAdministrators" - QuestionnaireDetail: - allOf: - - $ref: "#/components/schemas/QuestionnaireID" - - $ref: "#/components/schemas/Questionnaire" - - $ref: "#/components/schemas/QuestionnaireCreatedAt" - - $ref: "#/components/schemas/QuestionnaireModifiedAt" NewQuestionnaire: allOf: - $ref: "#/components/schemas/QuestionnaireTitle" @@ -621,13 +603,13 @@ components: - $ref: "#/components/schemas/QuestionnaireTargets" - $ref: "#/components/schemas/QuestionnaireAdministrators" - $ref: "#/components/schemas/QuestionnaireQuestions" - NewQuestionnaireResponse: + QuestionnaireDetail: allOf: - $ref: "#/components/schemas/QuestionnaireID" - - $ref: "#/components/schemas/Questionnaire" + - $ref: "#/components/schemas/NewQuestionnaire" - $ref: "#/components/schemas/QuestionnaireCreatedAt" - $ref: "#/components/schemas/QuestionnaireModifiedAt" - Questionnaire: + QuestionnaireSummary: allOf: - $ref: "#/components/schemas/QuestionnaireID" - $ref: "#/components/schemas/QuestionnaireTitle" @@ -637,7 +619,6 @@ components: - $ref: "#/components/schemas/QuestionnaireIsAnonymous" - $ref: "#/components/schemas/QuestionnaireAllowsMultipleResponses" - $ref: "#/components/schemas/QuestionnaireIsPublished" - - $ref: "#/components/schemas/QuestionnaireQuestions" QuestionnaireForList: allOf: - $ref: "#/components/schemas/Questionnaire" @@ -659,13 +640,13 @@ components: questionnaires: type: array items: - $ref: "#/components/schemas/QuestionnaireForList" + $ref: "#/components/schemas/QuestionnaireSummary" required: - page_max - questionnaires QuestionnaireByID: allOf: - - $ref: "#/components/schemas/NewQuestionnaireResponse" + - $ref: "#/components/schemas/QuestionnaireDetail" - type: object properties: respondents: @@ -688,7 +669,7 @@ components: - has_response QuestionnaireMyAdministrates: allOf: - - $ref: "#/components/schemas/NewQuestionnaireResponse" + - $ref: "#/components/schemas/QuestionnaireDetail" - type: object properties: all_responded: @@ -703,7 +684,7 @@ components: - respondents QuestionnaireUser: allOf: - - $ref: "#/components/schemas/NewQuestionnaireResponse" + - $ref: "#/components/schemas/QuestionnaireDetail" QuestionType: type: string example: Text From 85d6e438369ad8603df3e5b5ed1d7d47ed1dd092 Mon Sep 17 00:00:00 2001 From: rei Date: Sat, 9 Dec 2023 12:13:28 +0900 Subject: [PATCH 06/43] =?UTF-8?q?question=E3=82=92=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 186 +++++++++++++++++++------------------- 1 file changed, 92 insertions(+), 94 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index ef1d33b4..6176b0b9 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -141,7 +141,7 @@ paths: schema: type: array items: - $ref: "#/components/schemas/QuestionDetails" + $ref: "#/components/schemas/Question" "400": description: アンケートのIDが無効です "500": @@ -621,7 +621,7 @@ components: - $ref: "#/components/schemas/QuestionnaireIsPublished" QuestionnaireForList: allOf: - - $ref: "#/components/schemas/Questionnaire" + - $ref: "#/components/schemas/QuestionnaireSummary" - type: object properties: is_targeted: @@ -655,7 +655,7 @@ components: - respondents QuestionnaireMyTargeted: allOf: - - $ref: "#/components/schemas/Questionnaire" + - $ref: "#/components/schemas/QuestionnaireSummary" - type: object properties: responded_at: @@ -685,103 +685,17 @@ components: QuestionnaireUser: allOf: - $ref: "#/components/schemas/QuestionnaireDetail" - QuestionType: - type: string - example: Text - enum: - - Text - - TextArea - - Number - - MultipleChoice - - Checkbox - - LinearScale - description: | - どのタイプの質問か ("Text", "TextArea", "Number", "MultipleChoice", "Checkbox", "LinearScale") - QuestionBase: - type: object - properties: - page_num: - type: integer - example: 1 - description: | - アンケートの何ページ目の質問か - question_num: - type: integer - example: 1 - description: | - アンケートの質問のうち、何問目か - question_type: - $ref: "#/components/schemas/QuestionType" - body: - type: string - example: 質問文 - is_required: - type: boolean - example: true - description: | - 回答必須かどうか - options: - type: array - items: - type: string - example: 選択肢1 - scale_label_right: - type: string - example: そう思わない - scale_label_left: - type: string - example: そう思う - scale_min: - type: integer - example: 1 - scale_max: - type: integer - example: 5 - regex_pattern: - type: string - example: "" - min_bound: - type: string - example: "" - max_bound: - type: string - example: "" - required: - - page_num - - question_num - - question_type - - body - - is_required - - options - - scale_label_right - - scale_label_left - - scale_min - - scale_max + + # TODO: exampleを追加する NewQuestion: allOf: - $ref: "#/components/schemas/QuestionBase" - - type: object - properties: - questionnaireID: - type: integer - example: 1 - required: - - questionnaireID + - $ref: "#/components/schemas/QuestionSettingsByType" Question: - allOf: - - $ref: "#/components/schemas/NewQuestion" - - type: object - properties: - questionID: - type: integer - example: 1 - required: - - questionID - QuestionDetails: allOf: - $ref: "#/components/schemas/QuestionBase" - - type: object - properties: + - $ref: "#/components/schemas/QuestionSettingsByType" + - properties: questionID: type: integer example: 1 @@ -791,6 +705,89 @@ components: required: - questionID - created_at + Questions: + type: array + items: + $ref: "#/components/schemas/Question" + QuestionBase: + type: object + properties: + questionnaireID: + type: integer + example: 1 + questionType: + $ref: "#/components/schemas/QuestionType" + title: + type: string + description: + type: string + is_required: + type: boolean + required: + - questionType + - title + - description + - is_required + - questionnaireID + QuestionSettingsByType: + oneOf: + - $ref: "#/components/schemas/QuestionSettingsText" + - $ref: "#/components/schemas/QuestionSettingsTextLong" + - $ref: "#/components/schemas/QuestionSettingsNumber" + - $ref: "#/components/schemas/QuestionSettingsSingleChoice" + - $ref: "#/components/schemas/QuestionSettingsMultipleChoice" + - $ref: "#/components/schemas/QuestionSettingsScale" + QuestionSettingsText: + type: object + properties: + maxLength: + type: integer + QuestionSettingsTextLong: + type: object + properties: + maxLength: + type: number + QuestionSettingsNumber: + type: object + properties: + minValue: + type: integer + maxValue: + type: integer + QuestionSettingsSingleChoice: + type: object + properties: + options: + type: array + items: + type: string + QuestionSettingsMultipleChoice: + type: object + properties: + options: + type: array + items: + type: string + QuestionSettingsScale: + type: object + properties: + minValue: + type: integer + maxValue: + type: integer + QuestionType: + type: string + example: Text + enum: + - Text + - TextArea + - Number + - MultipleChoice + - Checkbox + - LinearScale + description: | + どのタイプの質問か ("Text", "TextLong", "Number", "SingleChoice", "MultipleChoice", "Scale") + NewResponse: type: object properties: @@ -1121,6 +1118,7 @@ components: items: type: string example: executive24 + securitySchemes: application: type: oauth2 From 64d72c6a48c1339a9baf2fbe178dea2376a8a568 Mon Sep 17 00:00:00 2001 From: rei Date: Sat, 9 Dec 2023 13:06:50 +0900 Subject: [PATCH 07/43] =?UTF-8?q?QuestionnaireList=E3=81=AB=E7=B5=B1?= =?UTF-8?q?=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 104 ++++++++++++-------------------------- 1 file changed, 32 insertions(+), 72 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 6176b0b9..543e74ad 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -40,7 +40,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/QuestionnairesWithPageMax" + $ref: "#/components/schemas/QuestionnaireList" "400": description: 与えられた情報の形式が異なります "500": @@ -84,7 +84,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/QuestionnaireByID" + $ref: "#/components/schemas/QuestionnaireList" "400": description: アンケートのIDが無効です "404": @@ -378,7 +378,7 @@ paths: schema: type: array items: - $ref: "#/components/schemas/QuestionnaireMyTargeted" + $ref: "#/components/schemas/QuestionnaireList" "500": description: 自分のUserIDが取得できませんでした /users/{traQID}/targeted: @@ -399,7 +399,7 @@ paths: schema: type: array items: - $ref: "#/components/schemas/QuestionnaireMyTargeted" + $ref: "#/components/schemas/QuestionnaireList" "400": description: 与えらえた情報の形式が異なります "500": @@ -418,7 +418,7 @@ paths: schema: type: array items: - $ref: "#/components/schemas/QuestionnaireMyAdministrates" + $ref: "#/components/schemas/QuestionnaireList" "500": description: 自分が管理者となっているアンケートのリストを取得できませんでした /groups: @@ -586,11 +586,11 @@ components: type: string example: public enum: - - administrators + - admins - respondents - public description: | - アンケートの結果を, 運営は見られる ("administrators"), 回答済みの人は見られる ("respondents") 誰でも見られる ("public") + アンケートの結果を, 運営は見られる ("admins"), 回答済みの人は見られる ("respondents") 誰でも見られる ("public") NewQuestionnaire: allOf: - $ref: "#/components/schemas/QuestionnaireTitle" @@ -600,13 +600,13 @@ components: - $ref: "#/components/schemas/QuestionnaireIsAnonymous" - $ref: "#/components/schemas/QuestionnaireAllowsMultipleResponses" - $ref: "#/components/schemas/QuestionnaireIsPublished" - - $ref: "#/components/schemas/QuestionnaireTargets" - - $ref: "#/components/schemas/QuestionnaireAdministrators" - - $ref: "#/components/schemas/QuestionnaireQuestions" + - $ref: "#/components/schemas/QuestionnaireTargetsAndAdmins" + - $ref: "#/components/schemas/Questions" QuestionnaireDetail: allOf: - $ref: "#/components/schemas/QuestionnaireID" - $ref: "#/components/schemas/NewQuestionnaire" + - $ref: "#/components/schemas/QuestionnaireRespondents" - $ref: "#/components/schemas/QuestionnaireCreatedAt" - $ref: "#/components/schemas/QuestionnaireModifiedAt" QuestionnaireSummary: @@ -619,72 +619,36 @@ components: - $ref: "#/components/schemas/QuestionnaireIsAnonymous" - $ref: "#/components/schemas/QuestionnaireAllowsMultipleResponses" - $ref: "#/components/schemas/QuestionnaireIsPublished" - QuestionnaireForList: - allOf: - - $ref: "#/components/schemas/QuestionnaireSummary" - - type: object - properties: - is_targeted: + - properties: + is_targeting_me: type: boolean example: true description: | 自分がターゲットになっているかどうか - required: - - is_targeted - QuestionnairesWithPageMax: - type: object - properties: - page_max: - type: integer - description: 最大ページ数 - questionnaires: - type: array - items: - $ref: "#/components/schemas/QuestionnaireSummary" - required: - - page_max - - questionnaires - QuestionnaireByID: - allOf: - - $ref: "#/components/schemas/QuestionnaireDetail" - - type: object - properties: - respondents: - $ref: "#/components/schemas/Users" - required: - - respondents - QuestionnaireMyTargeted: - allOf: - - $ref: "#/components/schemas/QuestionnaireSummary" - - type: object - properties: responded_at: type: string format: date-time - has_response: + has_my_draft: type: boolean - description: 回答済みあるいは下書きが存在する - required: - - responded_at - - has_response - QuestionnaireMyAdministrates: - allOf: - - $ref: "#/components/schemas/QuestionnaireDetail" - - type: object - properties: + description: 下書きが存在する + has_my_response: + type: boolean + description: 回答が存在する all_responded: type: boolean example: true description: | 回答必須でない場合、またはすべてのターゲットが回答済みの場合、true を返す。それ以外はfalseを返す。 - respondents: - $ref: "#/components/schemas/Users" required: + - is_targeting_me + - responded_at + - has_my_draft + - has_my_response - all_responded - - respondents - QuestionnaireUser: - allOf: - - $ref: "#/components/schemas/QuestionnaireDetail" + QuestionnaireList: + type: array + items: + $ref: "#/components/schemas/QuestionnaireSummary" # TODO: exampleを追加する NewQuestion: @@ -1059,10 +1023,13 @@ components: format: date-time required: - modified_at - QuestionnaireTargets: - $ref: "#/components/schemas/UsersAndGroups" - QuestionnaireAdministrators: - $ref: "#/components/schemas/UsersAndGroups" + QuestionnaireTargetsAndAdmins: + type: object + properties: + targets: + $ref: "#/components/schemas/UsersAndGroups" + admins: + $ref: "#/components/schemas/UsersAndGroups" QuestionnaireAllResponded: type: object properties: @@ -1091,13 +1058,6 @@ components: description: 回答済みあるいは下書きが存在する required: - has_response - QuestionnaireQuestions: - type: object - properties: - questions: - type: array - items: - $ref: "#/components/schemas/Question" UsersAndGroups: type: object properties: From d8b1073a49166817d518a020786ac97e361bc34e Mon Sep 17 00:00:00 2001 From: rei Date: Sat, 9 Dec 2023 13:07:42 +0900 Subject: [PATCH 08/43] =?UTF-8?q?CodeSpellChecker=E3=81=AEsettings.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..faddaff5 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "cSpell.words": [ + "anke", + "Bytra", + "lolico", + "mazrean", + "trapyojo", + "traq", + "varnames" + ] +} From 9f65511922cb99e5dc49eb6b3449723e1d3303f7 Mon Sep 17 00:00:00 2001 From: rei Date: Sun, 10 Dec 2023 16:39:56 +0900 Subject: [PATCH 09/43] =?UTF-8?q?questions=E3=82=92=E5=8F=96=E5=BE=97?= =?UTF-8?q?=E3=81=99=E3=82=8BAPI=E3=82=92=E5=89=8A=E9=99=A4=20response?= =?UTF-8?q?=E3=82=92=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 507 ++++++++++++++------------------------ 1 file changed, 190 insertions(+), 317 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 543e74ad..4ac3923e 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -84,7 +84,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/QuestionnaireList" + $ref: "#/components/schemas/QuestionnaireDetail" "400": description: アンケートのIDが無効です "404": @@ -103,7 +103,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/NewQuestionnaire" + $ref: "#/components/schemas/QuestionnaireDetail" responses: "200": description: 正常にアンケートを変更できました. @@ -125,84 +125,6 @@ paths: description: アンケートのIDが無効です "500": description: アンケートの削除ができませんでした - "/questionnaires/{questionnaireID}/questions": - get: - operationId: getQuestions - tags: - - questionnaire - description: アンケートに含まれる質問のリストを取得します。 - parameters: - - $ref: "#/components/parameters/questionnaireIDInPath" - responses: - "200": - description: 正常に取得できました。 - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/Question" - "400": - description: アンケートのIDが無効です - "500": - description: 質問のリストを取得できませんでした - post: - operationId: PostQuestionByQuestionnaireID - tags: - - questionnaire - parameters: - - $ref: "#/components/parameters/questionnaireIDInPath" - description: 新しい質問を作成します. - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/NewQuestion" - responses: - "201": - description: 正常に質問を作成できました.作成された質問を返します. - content: - application/json: - schema: - $ref: "#/components/schemas/Question" - "400": - description: 正常に作成できませんでした。リクエストが不正です。 - "500": - description: 正常に作成できません。主に正規表現が原因。 - "/questions/{questionID}": - patch: - operationId: editQuestion - tags: - - question - description: 質問を変更します. - parameters: - - $ref: "#/components/parameters/questionIDInPath" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/NewQuestion" - responses: - "200": - description: 正常に質問を変更できました. - "400": - description: 正常に変更できませんでした。リクエストが不正です。 - "500": - description: 正常に変更できませんでした。主に正規表現が原因。 - delete: - operationId: deleteQuestion - tags: - - question - description: 質問を削除します. - parameters: - - $ref: "#/components/parameters/questionIDInPath" - responses: - "200": - description: 正常に質問を削除できました。 - "500": - description: 正常に削除できませんでした。存在しない質問です。 /responses: post: operationId: postResponse @@ -214,14 +136,14 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/PostResponse" + $ref: "#/components/schemas/Response" responses: "201": description: 正常に回答を作成できました.作成された回答を返します. content: application/json: schema: - $ref: "#/components/schemas/ResponseDetails" + $ref: "#/components/schemas/Response" "400": description: 与えられた情報の形式が異なります "404": @@ -263,7 +185,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/NewResponse" + $ref: "#/components/schemas/Response" responses: "200": description: 正常に回答を変更できました. @@ -338,7 +260,7 @@ paths: schema: type: array items: - $ref: "#/components/schemas/ResponseSummary" + $ref: "#/components/schemas/Response" "500": description: Userが取得できませんでした "/users/me/responses/{questionnaireID}": @@ -357,7 +279,7 @@ paths: schema: type: array items: - $ref: "#/components/schemas/ResponseSummary" + $ref: "#/components/schemas/Response" "400": description: questionnaireIDの型が数値ではありません "500": @@ -454,7 +376,7 @@ paths: schema: type: array items: - $ref: "#/components/schemas/ResponseResult" + $ref: "#/components/schemas/Response" "400": description: questionnaireIDの型を数値に変換できませんでした "403": @@ -538,7 +460,7 @@ components: traQ ID(ex:mazrean) schema: type: string - schemas: + schemas: # TODO: description, example, requiredを確認する AnsweredType: type: string description: アンケート検索時に回答済みかの状態での絞り込み @@ -584,13 +506,13 @@ components: - ModifiedAtDESC ResShareType: type: string - example: public + example: anyone enum: - admins - respondents - - public + - anyone description: | - アンケートの結果を, 運営は見られる ("admins"), 回答済みの人は見られる ("respondents") 誰でも見られる ("public") + アンケートの結果を, 運営は見られる ("admins"), 回答済みの人は見られる ("respondents") 誰でも見られる ("anyone") NewQuestionnaire: allOf: - $ref: "#/components/schemas/QuestionnaireTitle" @@ -649,8 +571,127 @@ components: type: array items: $ref: "#/components/schemas/QuestionnaireSummary" + QuestionnaireID: + type: object + properties: + questionnaireID: + type: integer + example: 1 + required: + - questionnaireID + QuestionnaireTitle: + type: object + properties: + title: + type: string + example: 第1回集会らん☆ぷろ募集アンケート + required: + - title + QuestionnaireDescription: + type: object + properties: + description: + type: string + example: 第1回メンバー集会でのらん☆ぷろで発表したい人を募集します らん☆ぷろで発表したい人あつまれー! + required: + - description + QuestionnaireResponseDueDateTime: + type: object + properties: + response_due_date_time: + type: string + format: date-time + required: + - response_due_date_time + QuestionnaireResponseViewableBy: + type: object + properties: + response_viewable_by: + $ref: "#/components/schemas/ResShareType" + required: + - response_viewable_by + QuestionnaireIsAnonymous: + type: object + properties: + is_anonymous: + type: boolean + example: true + description: | + 匿名回答かどうか + required: + - is_anonymous + QuestionnaireAllowsMultipleResponses: + type: object + properties: + allows_multiple_responses: + type: boolean + example: true + description: | + 一人が複数回回答できるかどうか + required: + - allows_multiple_responses + QuestionnaireIsPublished: + type: object + properties: + is_published: + type: boolean + example: true + description: | + アンケートが公開されているかどうか + required: + - is_published + QuestionnaireCreatedAt: + type: object + properties: + created_at: + type: string + format: date-time + required: + - created_at + QuestionnaireModifiedAt: + type: object + properties: + modified_at: + type: string + format: date-time + required: + - modified_at + QuestionnaireTargetsAndAdmins: + type: object + properties: + targets: + $ref: "#/components/schemas/UsersAndGroups" + admins: + $ref: "#/components/schemas/UsersAndGroups" + QuestionnaireAllResponded: + type: object + properties: + all_responded: + type: boolean + example: true + description: | + 回答必須でない場合、またはすべてのターゲットが回答済みの場合、true を返す。それ以外はfalseを返す。 + required: + - all_responded + QuestionnaireRespondents: + $ref: "#/components/schemas/Users" + QuestionnaireRespondedAt: + type: object + properties: + responded_at: + type: string + format: date-time + required: + - responded_at + QuestionnaireHasMyResponse: + type: object + properties: + has_response: + type: boolean + description: 回答済みあるいは下書きが存在する + required: + - has_response - # TODO: exampleを追加する NewQuestion: allOf: - $ref: "#/components/schemas/QuestionBase" @@ -744,135 +785,83 @@ components: example: Text enum: - Text - - TextArea + - TextLong - Number + - SingleChoice - MultipleChoice - - Checkbox - - LinearScale + - Scale description: | - どのタイプの質問か ("Text", "TextLong", "Number", "SingleChoice", "MultipleChoice", "Scale") + どのタイプの質問か - NewResponse: + Response: type: object properties: - questionnaireID: - type: integer - example: 1 - body: - type: array - items: - $ref: "#/components/schemas/ResponseBody" + respondent: + type: string + example: lolico + is_draft: + type: boolean + example: true submitted_at: type: string format: date-time - required: - - temporarily - - questionnaireID - - body - PostResponse: - type: object - properties: - questionnaireID: - type: integer - example: 1 + modified_at: + type: string + format: date-time body: type: array items: $ref: "#/components/schemas/ResponseBody" - temporarily: - type: boolean - example: true - submitted_at: - type: string - format: date-time required: - - temporarily - - questionnaireID + - respondent + - is_draft + - submitted_at + - modified_at - body - Response: - allOf: - - $ref: "#/components/schemas/NewResponse" - - type: object - properties: - modified_at: - type: string - format: date-time - required: - - modified_at - ResponseDetails: - allOf: - - $ref: "#/components/schemas/NewResponse" - - type: object - properties: - responseID: - type: integer - example: 1 - required: - - responseID - ResponseSummary: + ResponseBody: + oneOf: + - $ref: "#/components/schemas/ResponseSettingsText" + - $ref: "#/components/schemas/ResponseSettingsTextLong" + - $ref: "#/components/schemas/ResponseSettingsNumber" + - $ref: "#/components/schemas/ResponseSettingsSingleChoice" + - $ref: "#/components/schemas/ResponseSettingsMultipleChoice" + - $ref: "#/components/schemas/ResponseSettingsScale" + ResponseSettingsText: type: object properties: - responseID: - type: integer - example: 1 - questionnaireID: - type: integer - example: 1 - questionnaire_title: - type: string - example: 第1回集会らん☆ぷろ募集アンケート - description: - type: string - example: 2017年度入学学部生 - res_time_limit: + text: type: string - format: date-time - submitted_at: - type: string - format: date-time - modified_at: + ResponseSettingsTextLong: + type: object + properties: + text: type: string - format: date-time - required: - - responseID - - questionnaireID - - questionnaire_title - - modified_at - ResponseBody: + ResponseSettingsNumber: type: object properties: - questionID: + number: + type: number + ResponseSettingsSingleChoice: + type: object + properties: + index: type: integer - example: 1 - question_type: - $ref: "#/components/schemas/QuestionType" - response: - type: string - example: リマインダーBOTを作った話 - option_response: + description: | + 選択肢のインデックス + ResponseSettingsMultipleChoice: + type: object + properties: + answerIndexes: type: array items: - type: string - example: 選択肢1 - required: - - questionID - - question_type - ResponseResult: - allOf: - - $ref: "#/components/schemas/Response" - - type: object - properties: - traqID: - type: string - example: lolico - responseID: - type: integer - example: 1 - required: - - traqID - - responseID - required: - - submitted_at + type: integer + description: | + 選択肢のインデックスの配列 + ResponseSettingsScale: + type: object + properties: + number: + type: integer User: type: object properties: @@ -938,126 +927,6 @@ components: - members - createdAt - updatedAt - QuestionnaireID: - type: object - properties: - questionnaireID: - type: integer - example: 1 - required: - - questionnaireID - QuestionnaireTitle: - type: object - properties: - title: - type: string - example: 第1回集会らん☆ぷろ募集アンケート - required: - - title - QuestionnaireDescription: - type: object - properties: - description: - type: string - example: 第1回メンバー集会でのらん☆ぷろで発表したい人を募集します らん☆ぷろで発表したい人あつまれー! - required: - - description - QuestionnaireResponseDueDateTime: - type: object - properties: - response_due_date_time: - type: string - format: date-time - required: - - response_due_date_time - QuestionnaireResponseViewableBy: - type: object - properties: - response_viewable_by: - $ref: "#/components/schemas/ResShareType" - required: - - response_viewable_by - QuestionnaireIsAnonymous: - type: object - properties: - is_anonymous: - type: boolean - example: true - description: | - 匿名回答かどうか - required: - - is_anonymous - QuestionnaireAllowsMultipleResponses: - type: object - properties: - allows_multiple_responses: - type: boolean - example: true - description: | - 一人が複数回回答できるかどうか - required: - - allows_multiple_responses - QuestionnaireIsPublished: - type: object - properties: - is_published: - type: boolean - example: true - description: | - アンケートが公開されているかどうか - required: - - is_published - QuestionnaireCreatedAt: - type: object - properties: - created_at: - type: string - format: date-time - required: - - created_at - QuestionnaireModifiedAt: - type: object - properties: - modified_at: - type: string - format: date-time - required: - - modified_at - QuestionnaireTargetsAndAdmins: - type: object - properties: - targets: - $ref: "#/components/schemas/UsersAndGroups" - admins: - $ref: "#/components/schemas/UsersAndGroups" - QuestionnaireAllResponded: - type: object - properties: - all_responded: - type: boolean - example: true - description: | - 回答必須でない場合、またはすべてのターゲットが回答済みの場合、true を返す。それ以外はfalseを返す。 - required: - - all_responded - QuestionnaireRespondents: - $ref: "#/components/schemas/Users" - QuestionnaireRespondedAt: - type: object - properties: - responded_at: - type: string - format: date-time - required: - - responded_at - QuestionnaireHasMyResponse: - type: object - properties: - has_response: - type: boolean - description: 回答済みあるいは下書きが存在する - required: - - has_response UsersAndGroups: type: object properties: @@ -1073,11 +942,15 @@ components: items: type: string example: cp20 + description: | + traQ ID Groups: type: array items: type: string - example: executive24 + example: 1 + description: | + Group UUID securitySchemes: application: From 0da27fcf20a91c4d871f9b2b42f5a4d0eb135464 Mon Sep 17 00:00:00 2001 From: rei Date: Sun, 10 Dec 2023 17:57:43 +0900 Subject: [PATCH 10/43] =?UTF-8?q?result=20schema=E3=81=AE=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20API=E3=81=AE=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 210 ++++++++++++++++++++++++++++++-------- 1 file changed, 165 insertions(+), 45 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 4ac3923e..7653a06e 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -23,7 +23,7 @@ tags: - name: group - name: result paths: - /questionnaires: + /questionnaires: # TODO: 取得個数可変でもいいかも get: operationId: getQuestionnaires tags: @@ -69,8 +69,7 @@ paths: description: 与えられた情報の形式が異なります "500": description: アンケートを正常に作成できませんでした - - "/questionnaires/{questionnaireID}": + /questionnaires/{questionnaireID}: get: operationId: getQuestionnaire tags: @@ -125,18 +124,40 @@ paths: description: アンケートのIDが無効です "500": description: アンケートの削除ができませんでした - /responses: + /questionnaires/{questionnaireID}/responses: + get: + operationId: getQuestionnaireResponses + tags: + - questionnaire + description: アンケートの全ての回答を取得します。アンケートが匿名回答の場合、取得できません。 + parameters: + - $ref: "#/components/parameters/questionnaireIDInPath" + responses: + "200": + description: 正常に取得できました。 + content: + application/json: + schema: + $ref: "#/components/schemas/Responses" + "400": + description: アンケートのIDが無効です + "403": + description: アンケートが匿名回答のため回答を取得できません + "404": + description: アンケートが存在しません + "500": + description: 回答を正常に取得できませんでした post: - operationId: postResponse + operationId: postQuestionnaireResponse tags: - - response - description: 新しい回答を作成します. + - questionnaire + description: 新しい回答を作成します。アンケートが複数回答可能でない場合、過去の回答が削除されます。 requestBody: required: true content: application/json: schema: - $ref: "#/components/schemas/Response" + $ref: "#/components/schemas/NewResponse" responses: "201": description: 正常に回答を作成できました.作成された回答を返します. @@ -152,12 +173,35 @@ paths: description: 回答期限が過ぎたため回答できません "500": description: 正常に回答が作成できませんでした - "/responses/{responseID}": + /questionnaires/{questionnaireID}/result: + get: + operationId: getQuestionnaireResult + tags: + - questionnaire + description: アンケートの回答を集計した結果を取得します。回答者の情報は含まれず、アンケートが匿名回答であっても取得できます。 + parameters: + - $ref: "#/components/parameters/questionnaireIDInPath" + responses: + "200": + description: 正常に取得できました。 + content: + application/json: + schema: + $ref: "#/components/schemas/Result" + "400": + description: アンケートのIDが無効です + "403": + description: 結果を閲覧する権限がありません。 + "404": + description: アンケートが存在しません + "500": + description: アンケートの結果を正常に取得できませんでした + /responses/{responseID}: get: operationId: getResponses tags: - response - description: あるresponseIDを持つ回答に含まれる全ての質問に対する自分の回答を取得します + description: あるresponseIDを持つ回答に含まれる全ての質問に対する自分の回答を取得します。 parameters: - $ref: "#/components/parameters/responseIDInPath" responses: @@ -169,6 +213,8 @@ paths: $ref: "#/components/schemas/Response" "400": description: responseIDが数値に変換できませんでした + "403": + description: 回答を閲覧する権限がありません。 "404": description: アンケートの回答の期限がきれたため回答が存在しません "500": @@ -191,6 +237,8 @@ paths: description: 正常に回答を変更できました. "400": description: 与えられた回答の情報が異なります + "403": + description: 回答を変更する権限がありません。 "404": description: アンケートの回答の期限がきれたため回答が存在しません "405": @@ -209,10 +257,12 @@ paths: description: 正常に回答を削除できました. "400": description: 与えられた回答の情報が異なります + "403": + description: 回答を削除する権限がありません。 "404": description: アンケートの回答の期限がきれたため回答が存在しません "405": - description: 回答期限が過ぎたため回答できません + description: 回答期限が過ぎたため回答を削除できません "500": description: responseIDを取得できませんでした /users: @@ -231,6 +281,8 @@ paths: type: array items: $ref: "#/components/schemas/User" + "500": + description: ユーザーのリストを取得できませんでした /users/me: get: operationId: getUsersMe @@ -260,10 +312,10 @@ paths: schema: type: array items: - $ref: "#/components/schemas/Response" + $ref: "#/components/schemas/Responses" "500": description: Userが取得できませんでした - "/users/me/responses/{questionnaireID}": + /users/me/responses/{questionnaireID}: get: operationId: getMyResponsesByID tags: @@ -359,30 +411,6 @@ paths: type: array items: $ref: "#/components/schemas/Group" - "/results/{questionnaireID}": - get: - operationId: getResults - tags: - - result - parameters: - - $ref: "#/components/parameters/questionnaireIDInPath" - - $ref: "#/components/parameters/responseSortInQuery" - description: あるquestionnaireIDを持つアンケートの結果をすべて取得します。 - responses: - "200": - description: 正常に取得できました。アンケートの各質問に対する結果の配列を返します。 - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/Response" - "400": - description: questionnaireIDの型を数値に変換できませんでした - "403": - description: 結果を閲覧する権限がありません。 - "500": - description: アンケートの回答の詳細情報一覧が取得できませんでした components: parameters: answeredInQuery: @@ -691,7 +719,6 @@ components: description: 回答済みあるいは下書きが存在する required: - has_response - NewQuestion: allOf: - $ref: "#/components/schemas/QuestionBase" @@ -792,10 +819,12 @@ components: - Scale description: | どのタイプの質問か - - Response: + NewResponse: type: object properties: + questionnaireID: + type: integer + example: 1 respondent: type: string example: lolico @@ -813,11 +842,26 @@ components: items: $ref: "#/components/schemas/ResponseBody" required: + - questionnaireID - respondent - is_draft - submitted_at - modified_at - body + Response: + allOf: + - type: object + properties: + responseID: + type: integer + example: 1 + required: + - responseID + - $ref: "#/components/schemas/NewResponse" + Responses: + type: array + items: + $ref: "#/components/schemas/Response" ResponseBody: oneOf: - $ref: "#/components/schemas/ResponseSettingsText" @@ -834,7 +878,7 @@ components: ResponseSettingsTextLong: type: object properties: - text: + textLong: type: string ResponseSettingsNumber: type: object @@ -862,10 +906,87 @@ components: properties: number: type: integer + Result: + type: object + properties: + questionnaireID: + type: integer + example: 1 + responseNum: + type: integer + example: 1 + body: + type: array + items: + $ref: "#/components/schemas/ResponseBody" + ResultBody: + oneOf: + - $ref: "#/components/schemas/ResponseSettingsText" + - $ref: "#/components/schemas/ResponseSettingsTextLong" + - $ref: "#/components/schemas/ResponseSettingsNumber" + - $ref: "#/components/schemas/ResponseSettingsSingleChoice" + - $ref: "#/components/schemas/ResponseSettingsMultipleChoice" + - $ref: "#/components/schemas/ResponseSettingsScale" + ResultSettingsText: + type: object + properties: + texts: + type: array + items: + type: string + description: | + 回答文の配列 + ResultSettingsTextLong: + type: object + properties: + textLongs: + type: array + items: + type: string + description: | + 回答文の配列 + ResultSettingsNumber: + type: object + properties: + number: + type: array + items: + type: array + items: + type: number + description: | + 値ごとの回答数の配列 + ResultSettingsSingleChoice: + type: object + properties: + index: + type: array + items: + type: array + items: + type: number + description: | + 選択肢ごとの回答数の配列 + ResultSettingsMultipleChoice: + type: object + properties: + answerIndexes: + type: array + items: + type: array + items: + type: number + description: | + 選択肢ごとの回答数の配列 + ResultSettingsScale: + type: object + properties: + number: + type: integer User: type: object properties: - userId: + userUUID: type: string format: uuid traqID: @@ -881,7 +1002,7 @@ components: type: string example: trapyojo required: - - userId + - userUUID - traqID - displayName - iconFileId @@ -897,7 +1018,7 @@ components: Group: type: object properties: - groupId: + groupUUID: type: string format: uuid name: @@ -951,7 +1072,6 @@ components: example: 1 description: | Group UUID - securitySchemes: application: type: oauth2 From f865ad9ae89952c7a01df086f781298142da6a5f Mon Sep 17 00:00:00 2001 From: rei Date: Sun, 10 Dec 2023 18:00:20 +0900 Subject: [PATCH 11/43] =?UTF-8?q?tag=E3=81=8B=E3=82=89question=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 7653a06e..8e01b0cf 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -17,7 +17,6 @@ security: - write tags: - name: questionnaire - - name: question - name: response - name: user - name: group From d5460ec20da63bf8032bf8f741bd15dd5c2fbb7d Mon Sep 17 00:00:00 2001 From: rei Date: Sun, 10 Dec 2023 19:04:17 +0900 Subject: [PATCH 12/43] =?UTF-8?q?NewQuestionnaire=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 8e01b0cf..9993ec5b 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -550,7 +550,11 @@ components: - $ref: "#/components/schemas/QuestionnaireAllowsMultipleResponses" - $ref: "#/components/schemas/QuestionnaireIsPublished" - $ref: "#/components/schemas/QuestionnaireTargetsAndAdmins" - - $ref: "#/components/schemas/Questions" + - properties: + questions: + type: array + items: + $ref: "#/components/schemas/NewQuestion" QuestionnaireDetail: allOf: - $ref: "#/components/schemas/QuestionnaireID" From 47f321766b8847456786b96689c25bbe3dcb1aa4 Mon Sep 17 00:00:00 2001 From: rei Date: Sun, 10 Dec 2023 19:19:04 +0900 Subject: [PATCH 13/43] =?UTF-8?q?isAdministratedByMe=E3=83=91=E3=83=A9?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=82=BF=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 9993ec5b..4987039c 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -33,6 +33,7 @@ paths: - $ref: "#/components/parameters/searchInQuery" - $ref: "#/components/parameters/pageInQuery" - $ref: "#/components/parameters/isTargetingMeInQuery" + - $ref: "#/components/parameters/isAdministratedByMeInQuery" responses: "200": description: 正常に取得できました。アンケートの配列を返します。 @@ -455,6 +456,13 @@ components: 自分がターゲットになっていないもののみ取得 (true), ターゲットになっているものも含めてすべて取得 (false)。デフォルトはfalse。 schema: type: boolean + isAdministratedByMeInQuery: + name: isAdministratedByMe + in: query + description: | + 自分が管理者になっていないもののみ取得 (true), 管理者になっているものも含めてすべて取得 (false)。デフォルトはfalse。 + schema: + type: boolean questionnaireIDInPath: name: questionnaireID in: path From 05d32742dceedb7ad78ee9f72b0af1e9965e6ff6 Mon Sep 17 00:00:00 2001 From: rei Date: Sun, 10 Dec 2023 19:21:31 +0900 Subject: [PATCH 14/43] /responses/MyResponse --- docs/swagger/swagger.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 4987039c..f516716e 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -265,6 +265,25 @@ paths: description: 回答期限が過ぎたため回答を削除できません "500": description: responseIDを取得できませんでした + /responses/MyResponse: + get: + operationId: getMyResponses + tags: + - response + description: 自分のすべての回答のリストを取得します。 + parameters: + - $ref: "#/components/parameters/sortInQuery" + responses: + "200": + description: 正常に取得できました。回答の配列を返します。 + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Response" + "500": + description: 自分の回答のリストを取得できませんでした /users: get: operationId: getUsers From 56fefd5c972b15114e4f40ba6fe71a2fa51dcaf6 Mon Sep 17 00:00:00 2001 From: rei Date: Sun, 10 Dec 2023 19:27:13 +0900 Subject: [PATCH 15/43] =?UTF-8?q?userAPI=E3=81=A8groupAPI=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 218 +------------------------------------- 1 file changed, 2 insertions(+), 216 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index f516716e..7ed6062f 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -18,10 +18,7 @@ security: tags: - name: questionnaire - name: response - - name: user - - name: group - - name: result -paths: +paths: #TODO: tagの整理 /questionnaires: # TODO: 取得個数可変でもいいかも get: operationId: getQuestionnaires @@ -265,7 +262,7 @@ paths: description: 回答期限が過ぎたため回答を削除できません "500": description: responseIDを取得できませんでした - /responses/MyResponse: + /responses/MyResponses: get: operationId: getMyResponses tags: @@ -284,152 +281,6 @@ paths: $ref: "#/components/schemas/Response" "500": description: 自分の回答のリストを取得できませんでした - /users: - get: - operationId: getUsers - tags: - - user - summary: 未実装 - description: (botおよび除名されたユーザーを除く、全ての) ユーザーのtraQIDのリストを取得します。 - responses: - "200": - description: 正常に取得できました.ユーザーの配列を返します. - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/User" - "500": - description: ユーザーのリストを取得できませんでした - /users/me: - get: - operationId: getUsersMe - tags: - - user - description: 自分のユーザー情報を取得します - responses: - "200": - description: 正常に取得できました。 - content: - application/json: - schema: - $ref: "#/components/schemas/Me" - "500": - description: Userが取得できませんでした - /users/me/responses: - get: - operationId: getMyResponses - tags: - - user - description: 自分のすべての回答のリストを取得します。 - responses: - "200": - description: 正常に取得できました。回答の配列を返します。 - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/Responses" - "500": - description: Userが取得できませんでした - /users/me/responses/{questionnaireID}: - get: - operationId: getMyResponsesByID - tags: - - user - parameters: - - $ref: "#/components/parameters/questionnaireIDInPath" - description: 特定のquestionnaireIdを持つアンケートに対する自分のすべての回答のリストを取得します。 - responses: - "200": - description: 正常に取得できました。回答の配列を返します。 - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/Response" - "400": - description: questionnaireIDの型が数値ではありません - "500": - description: 回答のリストを取得できませんでした - /users/me/targeted: - get: - operationId: getTargetedQuestionnaire - tags: - - user - description: 自分が対象になっている アンケートのリストを取得します。 - parameters: - - $ref: "#/components/parameters/sortInQuery" - responses: - "200": - description: 正常に取得できました。アンケートの配列を返します。 - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/QuestionnaireList" - "500": - description: 自分のUserIDが取得できませんでした - /users/{traQID}/targeted: - get: - operationId: getTargetedQuestionnairesBytraQID - tags: - - user - description: ユーザが対象になっているアンケートのリストを取得します。 - parameters: - - $ref: "#/components/parameters/sortInQuery" - - $ref: "#/components/parameters/answeredInQuery" - - $ref: "#/components/parameters/traQIDInPath" - responses: - "200": - description: 正常に取得できました。アンケートの配列を返します。 - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/QuestionnaireList" - "400": - description: 与えらえた情報の形式が異なります - "500": - description: 対象となっているアンケートのリストを取得できませんでした - /users/me/administrates: - get: - operationId: getMyQuestionnaire - tags: - - user - description: 自分が管理者になっているアンケートのリストを取得します。 - responses: - "200": - description: 正常に取得できました。アンケートの配列を返します。 - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/QuestionnaireList" - "500": - description: 自分が管理者となっているアンケートのリストを取得できませんでした - /groups: - get: - operationId: getGroups - tags: - - group - summary: 未実装 - description: (全ての) グループのリストを取得します - responses: - "200": - description: 正常に取得できました.グループの配列を返します. - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/Group" components: parameters: answeredInQuery: @@ -1013,71 +864,6 @@ components: properties: number: type: integer - User: - type: object - properties: - userUUID: - type: string - format: uuid - traqID: - type: string - example: lolico - displayName: - type: string - example: ロリ子 - iconFileId: - type: string - format: uuid - twitterId: - type: string - example: trapyojo - required: - - userUUID - - traqID - - displayName - - iconFileId - - twitterId - Me: - type: object - properties: - traqID: - type: string - example: lolico - required: - - traqID - Group: - type: object - properties: - groupUUID: - type: string - format: uuid - name: - type: string - example: 17B - description: - type: string - example: 2017年度入学学部生 - adminUser: - type: string - example: lolico - members: - type: array - items: - $ref: "#/components/schemas/Users" - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - required: - - groupId - - name - - description - - adminUser - - members - - createdAt - - updatedAt UsersAndGroups: type: object properties: From 5c294a6fdfdb948e681d99e5ce68521a97e5a5a6 Mon Sep 17 00:00:00 2001 From: rei Date: Sun, 10 Dec 2023 19:30:28 +0900 Subject: [PATCH 16/43] =?UTF-8?q?.gitignore=E3=81=AB.vscode/settings.json?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index fa996640..e0647f3b 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ mock_* *.png # End of https://www.gitignore.io/api/go + +.vscode/settings.json \ No newline at end of file From 04a7a1ffc92fef08d1a221d0ee65c086ab5a4069 Mon Sep 17 00:00:00 2001 From: rei Date: Sun, 10 Dec 2023 19:46:55 +0900 Subject: [PATCH 17/43] =?UTF-8?q?review=E3=81=AB=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=97=E3=81=9F=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 7ed6062f..c1f9751b 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -157,7 +157,7 @@ paths: #TODO: tagの整理 $ref: "#/components/schemas/NewResponse" responses: "201": - description: 正常に回答を作成できました.作成された回答を返します. + description: 正常に回答を作成できました。作成された回答を返します。 content: application/json: schema: @@ -166,7 +166,7 @@ paths: #TODO: tagの整理 description: 与えられた情報の形式が異なります "404": description: アンケートの回答の期限がきれたため回答が存在しません - "405": + "422": description: 回答期限が過ぎたため回答できません "500": description: 正常に回答が作成できませんでした @@ -195,10 +195,10 @@ paths: #TODO: tagの整理 description: アンケートの結果を正常に取得できませんでした /responses/{responseID}: get: - operationId: getResponses + operationId: getResponse tags: - response - description: あるresponseIDを持つ回答に含まれる全ての質問に対する自分の回答を取得します。 + description: 回答を取得します。 parameters: - $ref: "#/components/parameters/responseIDInPath" responses: @@ -209,18 +209,18 @@ paths: #TODO: tagの整理 schema: $ref: "#/components/schemas/Response" "400": - description: responseIDが数値に変換できませんでした + description: responseIDが無効です "403": description: 回答を閲覧する権限がありません。 "404": - description: アンケートの回答の期限がきれたため回答が存在しません + description: 回答が存在しません "500": - description: responseIDを取得できませんでした + description: 回答を正常に取得できませんでした patch: operationId: editResponse tags: - response - description: 回答を変更します. + description: 回答を変更します。 parameters: - $ref: "#/components/parameters/responseIDInPath" requestBody: @@ -231,11 +231,11 @@ paths: #TODO: tagの整理 $ref: "#/components/schemas/Response" responses: "200": - description: 正常に回答を変更できました. + description: 正常に回答を変更できました "400": description: 与えられた回答の情報が異なります "403": - description: 回答を変更する権限がありません。 + description: 回答を変更する権限がありません "404": description: アンケートの回答の期限がきれたため回答が存在しません "405": @@ -246,12 +246,12 @@ paths: #TODO: tagの整理 operationId: deleteResponse tags: - response - description: 回答を削除します. + description: 回答を削除します parameters: - $ref: "#/components/parameters/responseIDInPath" responses: "200": - description: 正常に回答を削除できました. + description: 正常に回答を削除できました "400": description: 与えられた回答の情報が異なります "403": @@ -323,7 +323,7 @@ components: name: isTargetingMe in: query description: | - 自分がターゲットになっていないもののみ取得 (true), ターゲットになっているものも含めてすべて取得 (false)。デフォルトはfalse。 + 自分がターゲットになっているもののみ取得 (true), ターゲットになっているものも含めてすべて取得 (false)。デフォルトはfalse。 schema: type: boolean isAdministratedByMeInQuery: From fd1293fa0489d02aab02e94dbcec1cc7d1f44805 Mon Sep 17 00:00:00 2001 From: rei Date: Sun, 10 Dec 2023 19:49:25 +0900 Subject: [PATCH 18/43] =?UTF-8?q?settings.json=E3=81=AE=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index faddaff5..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "cSpell.words": [ - "anke", - "Bytra", - "lolico", - "mazrean", - "trapyojo", - "traq", - "varnames" - ] -} From e923df56a267e558442b6a607b3fd470904472f9 Mon Sep 17 00:00:00 2001 From: rei Date: Sun, 10 Dec 2023 19:53:44 +0900 Subject: [PATCH 19/43] =?UTF-8?q?review=E3=81=AB=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=97=E3=81=9F=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index c1f9751b..85698c2b 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -165,7 +165,7 @@ paths: #TODO: tagの整理 "400": description: 与えられた情報の形式が異なります "404": - description: アンケートの回答の期限がきれたため回答が存在しません + description: アンケートが存在しません "422": description: 回答期限が過ぎたため回答できません "500": From acc0100a33d8ca2455053709f4b215265cce2cf6 Mon Sep 17 00:00:00 2001 From: rei Date: Sun, 10 Dec 2023 19:57:32 +0900 Subject: [PATCH 20/43] =?UTF-8?q?page=5Fmax=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 85698c2b..ad14d80f 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -477,9 +477,17 @@ components: - has_my_response - all_responded QuestionnaireList: - type: array - items: - $ref: "#/components/schemas/QuestionnaireSummary" + type: object + properties: + page_max: + type: integer + example: 1 + description: | + ページ数 + questionnaires: + type: array + items: + $ref: "#/components/schemas/QuestionnaireSummary" QuestionnaireID: type: object properties: From e501f7ed09d8488c57867b78f8a3e1aec5ad1c59 Mon Sep 17 00:00:00 2001 From: rei Date: Sun, 10 Dec 2023 20:24:10 +0900 Subject: [PATCH 21/43] =?UTF-8?q?review=E3=81=AB=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=97=E3=81=9F=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index ad14d80f..91a81a09 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -24,7 +24,7 @@ paths: #TODO: tagの整理 operationId: getQuestionnaires tags: - questionnaire - description: 与えられた条件を満たす20件以下のアンケートのリストを取得します. + description: 与えられた条件を満たす20件以下のアンケートのリストを取得します。 parameters: - $ref: "#/components/parameters/sortInQuery" - $ref: "#/components/parameters/searchInQuery" @@ -48,7 +48,7 @@ paths: #TODO: tagの整理 operationId: postQuestionnaire tags: - questionnaire - description: 新しいアンケートを作成します. + description: 新しいアンケートを作成します。 requestBody: required: true content: @@ -57,7 +57,7 @@ paths: #TODO: tagの整理 $ref: "#/components/schemas/NewQuestionnaire" responses: "201": - description: 正常にアンケートを作成できました.作成されたアンケートを返します. + description: 正常にアンケートを作成できました。作成されたアンケートを返します。 content: application/json: schema: @@ -91,7 +91,7 @@ paths: #TODO: tagの整理 operationId: editQuestionnaire tags: - questionnaire - description: アンケートの情報を変更します. + description: アンケートの情報を変更します。 parameters: - $ref: "#/components/parameters/questionnaireIDInPath" requestBody: @@ -102,7 +102,7 @@ paths: #TODO: tagの整理 $ref: "#/components/schemas/QuestionnaireDetail" responses: "200": - description: 正常にアンケートを変更できました. + description: 正常にアンケートを変更できました。 "400": description: アンケートのIDが無効です "500": @@ -111,12 +111,12 @@ paths: #TODO: tagの整理 operationId: deleteQuestionnaire tags: - questionnaire - description: アンケートを削除します. + description: アンケートを削除します。 parameters: - $ref: "#/components/parameters/questionnaireIDInPath" responses: "200": - description: 正常にアンケートを削除できました. + description: 正常にアンケートを削除できました。 "400": description: アンケートのIDが無効です "500": @@ -278,7 +278,7 @@ paths: #TODO: tagの整理 schema: type: array items: - $ref: "#/components/schemas/Response" + $ref: "#/components/schemas/Responses" "500": description: 自分の回答のリストを取得できませんでした components: @@ -711,9 +711,6 @@ components: NewResponse: type: object properties: - questionnaireID: - type: integer - example: 1 respondent: type: string example: lolico @@ -739,6 +736,7 @@ components: - body Response: allOf: + - $ref: "#/components/schemas/QuestionnaireID" - type: object properties: responseID: From 834f6831e7577cc123da524a9d08df144ecf26b4 Mon Sep 17 00:00:00 2001 From: rei Date: Sun, 10 Dec 2023 20:32:20 +0900 Subject: [PATCH 22/43] =?UTF-8?q?/users/me/responses/{questionnaireID}?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C=E3=81=99=E3=82=8BAPI=E3=82=92?= =?UTF-8?q?=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 91a81a09..f83d0ae3 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -18,7 +18,7 @@ security: tags: - name: questionnaire - name: response -paths: #TODO: tagの整理 +paths: /questionnaires: # TODO: 取得個数可変でもいいかも get: operationId: getQuestionnaires @@ -129,6 +129,8 @@ paths: #TODO: tagの整理 description: アンケートの全ての回答を取得します。アンケートが匿名回答の場合、取得できません。 parameters: - $ref: "#/components/parameters/questionnaireIDInPath" + - $ref: "#/components/parameters/responseSortInQuery" + - $ref: "#/components/parameters/isMyResponseInQuery" responses: "200": description: 正常に取得できました。 @@ -269,7 +271,7 @@ paths: #TODO: tagの整理 - response description: 自分のすべての回答のリストを取得します。 parameters: - - $ref: "#/components/parameters/sortInQuery" + - $ref: "#/components/parameters/responseSortInQuery" responses: "200": description: 正常に取得できました。回答の配列を返します。 @@ -333,6 +335,13 @@ components: 自分が管理者になっていないもののみ取得 (true), 管理者になっているものも含めてすべて取得 (false)。デフォルトはfalse。 schema: type: boolean + isMyResponseInQuery: + name: isMyResponse + in: query + description: | + 自分の回答のみ取得 (true), 自分の回答以外も含めてすべて取得 (false)。デフォルトはfalse。 + schema: + type: boolean questionnaireIDInPath: name: questionnaireID in: path From 5ea32994d7a76db338207dff483b10a26f0c3b23 Mon Sep 17 00:00:00 2001 From: rei Date: Sun, 10 Dec 2023 20:35:25 +0900 Subject: [PATCH 23/43] =?UTF-8?q?result=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index f83d0ae3..c0574558 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -814,7 +814,7 @@ components: body: type: array items: - $ref: "#/components/schemas/ResponseBody" + $ref: "#/components/schemas/ResultBody" ResultBody: oneOf: - $ref: "#/components/schemas/ResponseSettingsText" From 347c3b96de7be2dfefbee87e4ad75ad0b8ac1bc2 Mon Sep 17 00:00:00 2001 From: rei Date: Mon, 11 Dec 2023 01:00:04 +0900 Subject: [PATCH 24/43] =?UTF-8?q?review=E3=81=AB=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=97=E3=81=9F=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 45 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index c0574558..37e8f1a5 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -29,8 +29,8 @@ paths: - $ref: "#/components/parameters/sortInQuery" - $ref: "#/components/parameters/searchInQuery" - $ref: "#/components/parameters/pageInQuery" - - $ref: "#/components/parameters/isTargetingMeInQuery" - - $ref: "#/components/parameters/isAdministratedByMeInQuery" + - $ref: "#/components/parameters/onlyTargetingMeInQuery" + - $ref: "#/components/parameters/onlyAdministratedByMeInQuery" responses: "200": description: 正常に取得できました。アンケートの配列を返します。 @@ -130,7 +130,7 @@ paths: parameters: - $ref: "#/components/parameters/questionnaireIDInPath" - $ref: "#/components/parameters/responseSortInQuery" - - $ref: "#/components/parameters/isMyResponseInQuery" + - $ref: "#/components/parameters/onlyMyResponseInQuery" responses: "200": description: 正常に取得できました。 @@ -321,21 +321,21 @@ components: description: 何ページ目か (未定義の場合は1ページ目) schema: type: integer - isTargetingMeInQuery: + onlyTargetingMeInQuery: name: isTargetingMe in: query description: | 自分がターゲットになっているもののみ取得 (true), ターゲットになっているものも含めてすべて取得 (false)。デフォルトはfalse。 schema: type: boolean - isAdministratedByMeInQuery: + onlyAdministratedByMeInQuery: name: isAdministratedByMe in: query description: | 自分が管理者になっていないもののみ取得 (true), 管理者になっているものも含めてすべて取得 (false)。デフォルトはfalse。 schema: type: boolean - isMyResponseInQuery: + onlyMyResponseInQuery: name: isMyResponse in: query description: | @@ -492,7 +492,7 @@ components: type: integer example: 1 description: | - ページ数 + 合計のページ数 questionnaires: type: array items: @@ -589,6 +589,9 @@ components: $ref: "#/components/schemas/UsersAndGroups" admins: $ref: "#/components/schemas/UsersAndGroups" + required: + - targets + - admins QuestionnaireAllResponded: type: object properties: @@ -596,19 +599,11 @@ components: type: boolean example: true description: | - 回答必須でない場合、またはすべてのターゲットが回答済みの場合、true を返す。それ以外はfalseを返す。 + すべての対象者が回答済みの場合 true を返す。それ以外は false を返す。 (対象者が存在しない場合は true を返す) required: - all_responded QuestionnaireRespondents: $ref: "#/components/schemas/Users" - QuestionnaireRespondedAt: - type: object - properties: - responded_at: - type: string - format: date-time - required: - - responded_at QuestionnaireHasMyResponse: type: object properties: @@ -691,6 +686,8 @@ components: type: array items: type: string + required: + - options QuestionSettingsMultipleChoice: type: object properties: @@ -698,6 +695,8 @@ components: type: array items: type: string + required: + - options QuestionSettingsScale: type: object properties: @@ -808,7 +807,7 @@ components: questionnaireID: type: integer example: 1 - responseNum: + responseCount: type: integer example: 1 body: @@ -817,12 +816,12 @@ components: $ref: "#/components/schemas/ResultBody" ResultBody: oneOf: - - $ref: "#/components/schemas/ResponseSettingsText" - - $ref: "#/components/schemas/ResponseSettingsTextLong" - - $ref: "#/components/schemas/ResponseSettingsNumber" - - $ref: "#/components/schemas/ResponseSettingsSingleChoice" - - $ref: "#/components/schemas/ResponseSettingsMultipleChoice" - - $ref: "#/components/schemas/ResponseSettingsScale" + - $ref: "#/components/schemas/ResultSettingsText" + - $ref: "#/components/schemas/ResultSettingsTextLong" + - $ref: "#/components/schemas/ResultSettingsNumber" + - $ref: "#/components/schemas/ResultSettingsSingleChoice" + - $ref: "#/components/schemas/ResultSettingsMultipleChoice" + - $ref: "#/components/schemas/ResultSettingsScale" ResultSettingsText: type: object properties: From 0d84aa4dd26c026a71c88f38015071b0ed8bf492 Mon Sep 17 00:00:00 2001 From: rei Date: Mon, 11 Dec 2023 16:15:47 +0900 Subject: [PATCH 25/43] =?UTF-8?q?review=E3=81=AB=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=97=E3=81=9F=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 37e8f1a5..1124f315 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -151,6 +151,8 @@ paths: tags: - questionnaire description: 新しい回答を作成します。アンケートが複数回答可能でない場合、過去の回答が削除されます。 + parameters: + - $ref: "#/components/parameters/questionnaireIDInPath" requestBody: required: true content: @@ -434,7 +436,7 @@ components: - $ref: "#/components/schemas/QuestionnaireResponseDueDateTime" - $ref: "#/components/schemas/QuestionnaireResponseViewableBy" - $ref: "#/components/schemas/QuestionnaireIsAnonymous" - - $ref: "#/components/schemas/QuestionnaireAllowsMultipleResponses" + - $ref: "#/components/schemas/QuestionnaireIsAllowingMultipleResponses" - $ref: "#/components/schemas/QuestionnaireIsPublished" - $ref: "#/components/schemas/QuestionnaireTargetsAndAdmins" - properties: @@ -457,7 +459,7 @@ components: - $ref: "#/components/schemas/QuestionnaireResponseDueDateTime" - $ref: "#/components/schemas/QuestionnaireResponseViewableBy" - $ref: "#/components/schemas/QuestionnaireIsAnonymous" - - $ref: "#/components/schemas/QuestionnaireAllowsMultipleResponses" + - $ref: "#/components/schemas/QuestionnaireIsAllowingMultipleResponses" - $ref: "#/components/schemas/QuestionnaireIsPublished" - properties: is_targeting_me: @@ -546,16 +548,16 @@ components: 匿名回答かどうか required: - is_anonymous - QuestionnaireAllowsMultipleResponses: + QuestionnaireIsAllowingMultipleResponses: type: object properties: - allows_multiple_responses: + is_allowing_multiple_responses: type: boolean example: true description: | 一人が複数回回答できるかどうか required: - - allows_multiple_responses + - is_allowing_multiple_responses QuestionnaireIsPublished: type: object properties: From 1c00927c8beb6a845816d617b949440a252feac3 Mon Sep 17 00:00:00 2001 From: cp20 <47262658+cp-20@users.noreply.github.com> Date: Mon, 11 Dec 2023 21:50:50 +0900 Subject: [PATCH 26/43] Update docs/swagger/swagger.yaml (authorization) --- docs/swagger/swagger.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 1124f315..16000ec6 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -902,7 +902,8 @@ components: items: type: string example: 1 - description: | + authorizationUrl: "https://q.trap.jp/api/v3/oauth2/authorize" + tokenUrl: "https://q.trap.jp/api/v3/oauth2/token" Group UUID securitySchemes: application: From 77960a71b78b3784d5f9bf0d9ed805fa9b9da7cb Mon Sep 17 00:00:00 2001 From: rei Date: Tue, 12 Dec 2023 12:33:52 +0900 Subject: [PATCH 27/43] =?UTF-8?q?[docs]=20swagger.yaml=20required=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20description=E3=81=AE=E4=BF=AE=E6=AD=A3=20Q?= =?UTF-8?q?uestionnaireAllResponded=E3=81=AE=E5=89=8A=E9=99=A4=20QuestionT?= =?UTF-8?q?ype=E3=81=AE=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 362 +++++++++++++++++++++++++------------- 1 file changed, 235 insertions(+), 127 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 16000ec6..4ff5762c 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -429,6 +429,7 @@ components: - anyone description: | アンケートの結果を, 運営は見られる ("admins"), 回答済みの人は見られる ("respondents") 誰でも見られる ("anyone") + NewQuestionnaire: allOf: - $ref: "#/components/schemas/QuestionnaireTitle" @@ -444,6 +445,8 @@ components: type: array items: $ref: "#/components/schemas/NewQuestion" + required: + - questions QuestionnaireDetail: allOf: - $ref: "#/components/schemas/QuestionnaireID" @@ -480,7 +483,7 @@ components: type: boolean example: true description: | - 回答必須でない場合、またはすべてのターゲットが回答済みの場合、true を返す。それ以外はfalseを返す。 + すべての対象者が回答済みの場合 true を返す。それ以外は false を返す。 (対象者が存在しない場合は true を返す) required: - is_targeting_me - responded_at @@ -499,6 +502,9 @@ components: type: array items: $ref: "#/components/schemas/QuestionnaireSummary" + required: + - page_max + - questionnaires QuestionnaireID: type: object properties: @@ -594,16 +600,6 @@ components: required: - targets - admins - QuestionnaireAllResponded: - type: object - properties: - all_responded: - type: boolean - example: true - description: | - すべての対象者が回答済みの場合 true を返す。それ以外は false を返す。 (対象者が存在しない場合は true を返す) - required: - - all_responded QuestionnaireRespondents: $ref: "#/components/schemas/Users" QuestionnaireHasMyResponse: @@ -642,8 +638,6 @@ components: questionnaireID: type: integer example: 1 - questionType: - $ref: "#/components/schemas/QuestionType" title: type: string description: @@ -665,59 +659,70 @@ components: - $ref: "#/components/schemas/QuestionSettingsMultipleChoice" - $ref: "#/components/schemas/QuestionSettingsScale" QuestionSettingsText: - type: object - properties: - maxLength: - type: integer + allOf: + - $ref: "#/components/schemas/QuestionTypeText" + - type: object + properties: + maxLength: + type: integer + required: + - maxLength QuestionSettingsTextLong: - type: object - properties: - maxLength: - type: number + allOf: + - $ref: "#/components/schemas/QuestionTypeTextLong" + - type: object + properties: + maxLength: + type: number + required: + - maxLength QuestionSettingsNumber: - type: object - properties: - minValue: - type: integer - maxValue: - type: integer + allOf: + - $ref: "#/components/schemas/QuestionTypeNumber" + - type: object + properties: + minValue: + type: integer + maxValue: + type: integer + required: + - minValue + - maxValue QuestionSettingsSingleChoice: - type: object - properties: - options: - type: array - items: - type: string - required: - - options + allOf: + - $ref: "#/components/schemas/QuestionTypeSingleChoice" + - type: object + properties: + options: + type: array + items: + type: string + required: + - options QuestionSettingsMultipleChoice: - type: object - properties: - options: - type: array - items: - type: string - required: - - options + allOf: + - $ref: "#/components/schemas/QuestionTypeMultipleChoice" + - type: object + properties: + options: + type: array + items: + type: string + required: + - options QuestionSettingsScale: - type: object - properties: - minValue: - type: integer - maxValue: - type: integer - QuestionType: - type: string - example: Text - enum: - - Text - - TextLong - - Number - - SingleChoice - - MultipleChoice - - Scale - description: | - どのタイプの質問か + allOf: + - $ref: "#/components/schemas/QuestionTypeScale" + - type: object + properties: + minValue: + type: integer + maxValue: + type: integer + required: + - minValue + - maxValue + NewResponse: type: object properties: @@ -738,7 +743,6 @@ components: items: $ref: "#/components/schemas/ResponseBody" required: - - questionnaireID - respondent - is_draft - submitted_at @@ -768,41 +772,113 @@ components: - $ref: "#/components/schemas/ResponseSettingsMultipleChoice" - $ref: "#/components/schemas/ResponseSettingsScale" ResponseSettingsText: + allOf: + - $ref: "#/components/schemas/QuestionTypeText" + - type: object + properties: + text: + type: string + required: + - text + ResponseSettingsTextLong: + allOf: + - $ref: "#/components/schemas/QuestionTypeTextLong" + - type: object + properties: + textLong: + type: string + required: + - textLong + ResponseSettingsNumber: + allOf: + - $ref: "#/components/schemas/QuestionTypeNumber" + - type: object + properties: + number: + type: number + required: + - number + ResponseSettingsSingleChoice: + allOf: + - $ref: "#/components/schemas/QuestionTypeSingleChoice" + - type: object + properties: + index: + type: integer + description: | + 選択肢のインデックス + required: + - index + ResponseSettingsMultipleChoice: + allOf: + - $ref: "#/components/schemas/QuestionTypeMultipleChoice" + - type: object + properties: + indexes: + type: array + items: + type: integer + description: | + 選択肢のインデックスの配列 + required: + - indexes + ResponseSettingsScale: + allOf: + - $ref: "#/components/schemas/QuestionTypeScale" + - type: object + properties: + number: + type: integer + required: + - number + QuestionTypeText: type: object properties: - text: + questionType: type: string - ResponseSettingsTextLong: + enum: [Text] + required: + - questionType + QuestionTypeTextLong: type: object properties: - textLong: + questionType: type: string - ResponseSettingsNumber: + enum: [TextLong] + required: + - questionType + QuestionTypeNumber: type: object properties: - number: - type: number - ResponseSettingsSingleChoice: + questionType: + type: string + enum: [Number] + required: + - questionType + QuestionTypeSingleChoice: type: object properties: - index: - type: integer - description: | - 選択肢のインデックス - ResponseSettingsMultipleChoice: + questionType: + type: string + enum: [SingleChoice] + required: + - questionType + QuestionTypeMultipleChoice: type: object properties: - answerIndexes: - type: array - items: - type: integer - description: | - 選択肢のインデックスの配列 - ResponseSettingsScale: + questionType: + type: string + enum: [MultipleChoice] + required: + - questionType + QuestionTypeScale: type: object properties: - number: - type: integer + questionType: + type: string + enum: [Scale] + required: + - questionType Result: type: object properties: @@ -816,6 +892,10 @@ components: type: array items: $ref: "#/components/schemas/ResultBody" + required: + - questionnaireID + - responseCount + - body ResultBody: oneOf: - $ref: "#/components/schemas/ResultSettingsText" @@ -825,61 +905,89 @@ components: - $ref: "#/components/schemas/ResultSettingsMultipleChoice" - $ref: "#/components/schemas/ResultSettingsScale" ResultSettingsText: - type: object - properties: - texts: - type: array - items: - type: string - description: | - 回答文の配列 + allOf: + - $ref: "#/components/schemas/QuestionTypeText" + - type: object + properties: + answers: + type: array + items: + type: string + description: | + 回答文の配列 + required: + - texts ResultSettingsTextLong: - type: object - properties: - textLongs: - type: array - items: - type: string - description: | - 回答文の配列 + allOf: + - $ref: "#/components/schemas/QuestionTypeTextLong" + - type: object + properties: + answers: + type: array + items: + type: string + description: | + 回答文の配列 + required: + - textLongs ResultSettingsNumber: - type: object - properties: - number: - type: array - items: - type: array - items: - type: number - description: | - 値ごとの回答数の配列 + allOf: + - $ref: "#/components/schemas/QuestionTypeNumber" + - $ref: "#/components/schemas/ResultSettingsAnswerCountPerNumber" + description: | + 数値ごとの回答数の配列 ResultSettingsSingleChoice: + allOf: + - $ref: "#/components/schemas/QuestionTypeSingleChoice" + - $ref: "#/components/schemas/ResultSettingsAnswerCountPerIndex" + description: | + 選択肢ごとの回答数の配列 + ResultSettingsMultipleChoice: + allOf: + - $ref: "#/components/schemas/QuestionTypeMultipleChoice" + - $ref: "#/components/schemas/ResultSettingsAnswerCountPerIndex" + description: | + 選択肢ごとの回答数の配列 + ResultSettingsScale: + allOf: + - $ref: "#/components/schemas/QuestionTypeScale" + - $ref: "#/components/schemas/ResultSettingsAnswerCountPerNumber" + description: | + 数値ごとの回答数の配列 + ResultSettingsAnswerCountPerNumber: type: object properties: - index: + answerCountPerNumber: #TODO: 配列なのに複数形じゃないの気になる type: array items: - type: array - items: - type: number - description: | - 選択肢ごとの回答数の配列 - ResultSettingsMultipleChoice: + type: object + properties: + number: + type: number + answerCount: + type: number + required: + - number + - answerCount + required: + - indexes + ResultSettingsAnswerCountPerIndex: type: object properties: - answerIndexes: + AnswerCountPerIndex: #TODO: 配列なのに複数形じゃないの気になるv2 type: array items: - type: array - items: - type: number - description: | - 選択肢ごとの回答数の配列 - ResultSettingsScale: - type: object - properties: - number: - type: integer + type: object + properties: + index: + type: number + answerCount: + type: number + required: + - index + - answerCount + required: + - indexes UsersAndGroups: type: object properties: From 737df2e4822265d6fe20712cd18a2a79b2ea7fc0 Mon Sep 17 00:00:00 2001 From: rei Date: Tue, 12 Dec 2023 15:48:45 +0900 Subject: [PATCH 28/43] =?UTF-8?q?[docs]=20swagger.yaml=20git=20pull=20--re?= =?UTF-8?q?base=20=E3=81=A7=E7=99=BA=E7=94=9F=E3=81=97=E3=81=9F=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 4ff5762c..67e91191 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -1010,8 +1010,7 @@ components: items: type: string example: 1 - authorizationUrl: "https://q.trap.jp/api/v3/oauth2/authorize" - tokenUrl: "https://q.trap.jp/api/v3/oauth2/token" + description: | Group UUID securitySchemes: application: From ca0a478dca1e3127fb159446b4f6fe6db7fded92 Mon Sep 17 00:00:00 2001 From: cp-20 <47262658+mario-hsp@users.noreply.github.com> Date: Tue, 12 Dec 2023 15:53:46 +0900 Subject: [PATCH 29/43] =?UTF-8?q?chore:=20swagger.yaml=20=E3=81=AEauthoriz?= =?UTF-8?q?ation=E5=91=A8=E3=82=8A=E3=82=92=E6=95=B4=E5=82=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 67e91191..bdce6f6e 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -1017,7 +1017,8 @@ components: type: oauth2 flows: clientCredentials: - tokenUrl: "http://example.com/oauth/token" + authorizationUrl: "https://q.trap.jp/api/v3/oauth2/authorize" + tokenUrl: "https://q.trap.jp/api/v3/oauth2/token" scopes: write: allows modifying resources read: allows reading resources From d189d035d7e8cfa94b7416d0cca330bf26fb00c4 Mon Sep 17 00:00:00 2001 From: rei Date: Tue, 12 Dec 2023 16:06:23 +0900 Subject: [PATCH 30/43] =?UTF-8?q?[chore]=20swagger.yaml=20QuestionnaireRes?= =?UTF-8?q?pondents=E3=81=AE=E3=83=9F=E3=82=B9=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index bdce6f6e..40a82263 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -601,7 +601,12 @@ components: - targets - admins QuestionnaireRespondents: - $ref: "#/components/schemas/Users" + type: object + properties: + respondents: + $ref: "#/components/schemas/Users" + required: + - respondents QuestionnaireHasMyResponse: type: object properties: From f9ccc61c12edd02e6f1633e13989b72b4022a4de Mon Sep 17 00:00:00 2001 From: cp-20 <47262658+mario-hsp@users.noreply.github.com> Date: Tue, 12 Dec 2023 16:07:58 +0900 Subject: [PATCH 31/43] =?UTF-8?q?chore:=20securitySchemas=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index bdce6f6e..53279fef 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -1016,7 +1016,7 @@ components: application: type: oauth2 flows: - clientCredentials: + authorizationCode: authorizationUrl: "https://q.trap.jp/api/v3/oauth2/authorize" tokenUrl: "https://q.trap.jp/api/v3/oauth2/token" scopes: From 25a3b0d1548bbaf31c53d2cc6313442bebd07215 Mon Sep 17 00:00:00 2001 From: rei Date: Tue, 12 Dec 2023 16:12:56 +0900 Subject: [PATCH 32/43] =?UTF-8?q?[chore]=20swagger.yaml=20review=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E3=81=97=E3=81=9F=E7=B4=B0=E3=81=8B=E3=81=AA?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 7d473955..dc472542 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -18,7 +18,7 @@ security: tags: - name: questionnaire - name: response -paths: +paths: #TODO 変数の命名を確認する /questionnaires: # TODO: 取得個数可変でもいいかも get: operationId: getQuestionnaires @@ -324,21 +324,21 @@ components: schema: type: integer onlyTargetingMeInQuery: - name: isTargetingMe + name: onlyTargetingMe in: query description: | 自分がターゲットになっているもののみ取得 (true), ターゲットになっているものも含めてすべて取得 (false)。デフォルトはfalse。 schema: type: boolean onlyAdministratedByMeInQuery: - name: isAdministratedByMe + name: onlyAdministratedByMe in: query description: | 自分が管理者になっていないもののみ取得 (true), 管理者になっているものも含めてすべて取得 (false)。デフォルトはfalse。 schema: type: boolean onlyMyResponseInQuery: - name: isMyResponse + name: onlyMyResponse in: query description: | 自分の回答のみ取得 (true), 自分の回答以外も含めてすべて取得 (false)。デフォルトはfalse。 From 6f2cb34df95a434758ced911631c1f17231ac24d Mon Sep 17 00:00:00 2001 From: rei Date: Tue, 12 Dec 2023 16:38:13 +0900 Subject: [PATCH 33/43] =?UTF-8?q?[chore]=20swagger.yaml=20/questionnaires/?= =?UTF-8?q?{questionnaireID}/myRemindStatus=20=E3=81=AE=E4=BD=9C=E6=88=90(?= =?UTF-8?q?=E3=83=97=E3=83=AD=E3=83=88=E3=82=BF=E3=82=A4=E3=83=97)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 49 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index dc472542..c82469c0 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -121,6 +121,49 @@ paths: #TODO 変数の命名を確認する description: アンケートのIDが無効です "500": description: アンケートの削除ができませんでした + /questionnaires/{questionnaireID}/myRemindStatus: + get: + operationId: getQuestionnaireMyRemindStatus + tags: + - questionnaire + description: 自分に対するリマインドが有効かどうかを取得します。 + parameters: + - $ref: "#/components/parameters/questionnaireIDInPath" + responses: + "200": + description: 正常に取得できました。 + content: + application/json: + schema: + $ref: "#/components/schemas/QuestionnaireMyRemindStatus" + "400": + description: アンケートのIDが無効です + "404": + description: アンケートが存在しません + "500": + description: リマインド設定を正常に取得できませんでした + patch: + operationId: editQuestionnaireMyRemindStatus + tags: + - questionnaire + description: 自分に対するリマインドが有効かどうかを変更します。 + parameters: + - $ref: "#/components/parameters/questionnaireIDInPath" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/QuestionnaireMyRemindStatus" + responses: + "200": + description: 正常に変更できました。 + "400": + description: アンケートのIDが無効です + "404": + description: アンケートが存在しません + "500": + description: リマインド設定を正常に変更できませんでした /questionnaires/{questionnaireID}/responses: get: operationId: getQuestionnaireResponses @@ -266,7 +309,7 @@ paths: #TODO 変数の命名を確認する description: 回答期限が過ぎたため回答を削除できません "500": description: responseIDを取得できませんでした - /responses/MyResponses: + /responses/myResponses: get: operationId: getMyResponses tags: @@ -615,6 +658,10 @@ components: description: 回答済みあるいは下書きが存在する required: - has_response + QuestionnaireMyRemindStatus: + type: boolean + description: | + 自分に対するリマインドが有効かどうか NewQuestion: allOf: - $ref: "#/components/schemas/QuestionBase" From 70aa42c461d057026a84d573666d9578df544a5e Mon Sep 17 00:00:00 2001 From: rei Date: Tue, 12 Dec 2023 16:44:37 +0900 Subject: [PATCH 34/43] =?UTF-8?q?[chore]=20swagger.yaml=20QuestionnaireMyR?= =?UTF-8?q?emindStatus=E3=81=AEdescription=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index c82469c0..2e8e785a 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -661,7 +661,7 @@ components: QuestionnaireMyRemindStatus: type: boolean description: | - 自分に対するリマインドが有効かどうか + 自分に対するリマインドが有効かどうか。ユーザーが対象者でありかつ回答していない場合、この値がtrueであればリマインドが送信される。 NewQuestion: allOf: - $ref: "#/components/schemas/QuestionBase" From 831dfda693013592fd4b1f17d577a40ab5476ae9 Mon Sep 17 00:00:00 2001 From: cp-20 <47262658+mario-hsp@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:44:28 +0900 Subject: [PATCH 35/43] =?UTF-8?q?chore:=20swagger.yaml=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(NewResponse=E3=81=AErespondent=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4=E3=80=81submitted=5Fat=E3=81=A8modified=5Fat=E3=82=92?= =?UTF-8?q?Response=E3=81=AB=E7=A7=BB=E5=8B=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 378 +++++++++++++++++++------------------- 1 file changed, 187 insertions(+), 191 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 2e8e785a..3b9bfeca 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -1,8 +1,8 @@ openapi: 3.0.0 servers: - - url: "https://anke-to.trap.jp/api" + - url: 'https://anke-to.trap.jp/api' description: production - - url: "http://localhost:8080/api" + - url: 'http://localhost:8080/api' description: local info: title: anke-to API @@ -10,7 +10,7 @@ info: description: anke-to API contact: name: traP - url: "https://github.com/traPtitech/anke-to" + url: 'https://github.com/traPtitech/anke-to' security: - application: - read @@ -26,23 +26,23 @@ paths: #TODO 変数の命名を確認する - questionnaire description: 与えられた条件を満たす20件以下のアンケートのリストを取得します。 parameters: - - $ref: "#/components/parameters/sortInQuery" - - $ref: "#/components/parameters/searchInQuery" - - $ref: "#/components/parameters/pageInQuery" - - $ref: "#/components/parameters/onlyTargetingMeInQuery" - - $ref: "#/components/parameters/onlyAdministratedByMeInQuery" + - $ref: '#/components/parameters/sortInQuery' + - $ref: '#/components/parameters/searchInQuery' + - $ref: '#/components/parameters/pageInQuery' + - $ref: '#/components/parameters/onlyTargetingMeInQuery' + - $ref: '#/components/parameters/onlyAdministratedByMeInQuery' responses: - "200": + '200': description: 正常に取得できました。アンケートの配列を返します。 content: application/json: schema: - $ref: "#/components/schemas/QuestionnaireList" - "400": + $ref: '#/components/schemas/QuestionnaireList' + '400': description: 与えられた情報の形式が異なります - "500": + '500': description: アンケートを正常に取得できませんでした - "503": + '503': description: SQLの実行時間が3sを超えた場合。主に正規表現が原因。 post: operationId: postQuestionnaire @@ -54,17 +54,17 @@ paths: #TODO 変数の命名を確認する content: application/json: schema: - $ref: "#/components/schemas/NewQuestionnaire" + $ref: '#/components/schemas/NewQuestionnaire' responses: - "201": + '201': description: 正常にアンケートを作成できました。作成されたアンケートを返します。 content: application/json: schema: - $ref: "#/components/schemas/QuestionnaireDetail" - "400": + $ref: '#/components/schemas/QuestionnaireDetail' + '400': description: 与えられた情報の形式が異なります - "500": + '500': description: アンケートを正常に作成できませんでした /questionnaires/{questionnaireID}: get: @@ -73,19 +73,19 @@ paths: #TODO 変数の命名を確認する - questionnaire description: アンケートの情報を取得します。 parameters: - - $ref: "#/components/parameters/questionnaireIDInPath" + - $ref: '#/components/parameters/questionnaireIDInPath' responses: - "200": + '200': description: 正常に取得できました。 content: application/json: schema: - $ref: "#/components/schemas/QuestionnaireDetail" - "400": + $ref: '#/components/schemas/QuestionnaireDetail' + '400': description: アンケートのIDが無効です - "404": + '404': description: アンケートが存在しません - "500": + '500': description: アンケートを正常に取得できませんでした patch: operationId: editQuestionnaire @@ -93,19 +93,19 @@ paths: #TODO 変数の命名を確認する - questionnaire description: アンケートの情報を変更します。 parameters: - - $ref: "#/components/parameters/questionnaireIDInPath" + - $ref: '#/components/parameters/questionnaireIDInPath' requestBody: required: true content: application/json: schema: - $ref: "#/components/schemas/QuestionnaireDetail" + $ref: '#/components/schemas/QuestionnaireDetail' responses: - "200": + '200': description: 正常にアンケートを変更できました。 - "400": + '400': description: アンケートのIDが無効です - "500": + '500': description: 正常にアンケートを変更できませんでした delete: operationId: deleteQuestionnaire @@ -113,13 +113,13 @@ paths: #TODO 変数の命名を確認する - questionnaire description: アンケートを削除します。 parameters: - - $ref: "#/components/parameters/questionnaireIDInPath" + - $ref: '#/components/parameters/questionnaireIDInPath' responses: - "200": + '200': description: 正常にアンケートを削除できました。 - "400": + '400': description: アンケートのIDが無効です - "500": + '500': description: アンケートの削除ができませんでした /questionnaires/{questionnaireID}/myRemindStatus: get: @@ -128,19 +128,19 @@ paths: #TODO 変数の命名を確認する - questionnaire description: 自分に対するリマインドが有効かどうかを取得します。 parameters: - - $ref: "#/components/parameters/questionnaireIDInPath" + - $ref: '#/components/parameters/questionnaireIDInPath' responses: - "200": + '200': description: 正常に取得できました。 content: application/json: schema: - $ref: "#/components/schemas/QuestionnaireMyRemindStatus" - "400": + $ref: '#/components/schemas/QuestionnaireMyRemindStatus' + '400': description: アンケートのIDが無効です - "404": + '404': description: アンケートが存在しません - "500": + '500': description: リマインド設定を正常に取得できませんでした patch: operationId: editQuestionnaireMyRemindStatus @@ -148,21 +148,21 @@ paths: #TODO 変数の命名を確認する - questionnaire description: 自分に対するリマインドが有効かどうかを変更します。 parameters: - - $ref: "#/components/parameters/questionnaireIDInPath" + - $ref: '#/components/parameters/questionnaireIDInPath' requestBody: required: true content: application/json: schema: - $ref: "#/components/schemas/QuestionnaireMyRemindStatus" + $ref: '#/components/schemas/QuestionnaireMyRemindStatus' responses: - "200": + '200': description: 正常に変更できました。 - "400": + '400': description: アンケートのIDが無効です - "404": + '404': description: アンケートが存在しません - "500": + '500': description: リマインド設定を正常に変更できませんでした /questionnaires/{questionnaireID}/responses: get: @@ -171,23 +171,23 @@ paths: #TODO 変数の命名を確認する - questionnaire description: アンケートの全ての回答を取得します。アンケートが匿名回答の場合、取得できません。 parameters: - - $ref: "#/components/parameters/questionnaireIDInPath" - - $ref: "#/components/parameters/responseSortInQuery" - - $ref: "#/components/parameters/onlyMyResponseInQuery" + - $ref: '#/components/parameters/questionnaireIDInPath' + - $ref: '#/components/parameters/responseSortInQuery' + - $ref: '#/components/parameters/onlyMyResponseInQuery' responses: - "200": + '200': description: 正常に取得できました。 content: application/json: schema: - $ref: "#/components/schemas/Responses" - "400": + $ref: '#/components/schemas/Responses' + '400': description: アンケートのIDが無効です - "403": + '403': description: アンケートが匿名回答のため回答を取得できません - "404": + '404': description: アンケートが存在しません - "500": + '500': description: 回答を正常に取得できませんでした post: operationId: postQuestionnaireResponse @@ -195,27 +195,27 @@ paths: #TODO 変数の命名を確認する - questionnaire description: 新しい回答を作成します。アンケートが複数回答可能でない場合、過去の回答が削除されます。 parameters: - - $ref: "#/components/parameters/questionnaireIDInPath" + - $ref: '#/components/parameters/questionnaireIDInPath' requestBody: required: true content: application/json: schema: - $ref: "#/components/schemas/NewResponse" + $ref: '#/components/schemas/NewResponse' responses: - "201": + '201': description: 正常に回答を作成できました。作成された回答を返します。 content: application/json: schema: - $ref: "#/components/schemas/Response" - "400": + $ref: '#/components/schemas/Response' + '400': description: 与えられた情報の形式が異なります - "404": + '404': description: アンケートが存在しません - "422": + '422': description: 回答期限が過ぎたため回答できません - "500": + '500': description: 正常に回答が作成できませんでした /questionnaires/{questionnaireID}/result: get: @@ -224,21 +224,21 @@ paths: #TODO 変数の命名を確認する - questionnaire description: アンケートの回答を集計した結果を取得します。回答者の情報は含まれず、アンケートが匿名回答であっても取得できます。 parameters: - - $ref: "#/components/parameters/questionnaireIDInPath" + - $ref: '#/components/parameters/questionnaireIDInPath' responses: - "200": + '200': description: 正常に取得できました。 content: application/json: schema: - $ref: "#/components/schemas/Result" - "400": + $ref: '#/components/schemas/Result' + '400': description: アンケートのIDが無効です - "403": + '403': description: 結果を閲覧する権限がありません。 - "404": + '404': description: アンケートが存在しません - "500": + '500': description: アンケートの結果を正常に取得できませんでした /responses/{responseID}: get: @@ -247,21 +247,21 @@ paths: #TODO 変数の命名を確認する - response description: 回答を取得します。 parameters: - - $ref: "#/components/parameters/responseIDInPath" + - $ref: '#/components/parameters/responseIDInPath' responses: - "200": + '200': description: 正常に取得できました。 content: application/json: schema: - $ref: "#/components/schemas/Response" - "400": + $ref: '#/components/schemas/Response' + '400': description: responseIDが無効です - "403": + '403': description: 回答を閲覧する権限がありません。 - "404": + '404': description: 回答が存在しません - "500": + '500': description: 回答を正常に取得できませんでした patch: operationId: editResponse @@ -269,25 +269,25 @@ paths: #TODO 変数の命名を確認する - response description: 回答を変更します。 parameters: - - $ref: "#/components/parameters/responseIDInPath" + - $ref: '#/components/parameters/responseIDInPath' requestBody: required: true content: application/json: schema: - $ref: "#/components/schemas/Response" + $ref: '#/components/schemas/Response' responses: - "200": + '200': description: 正常に回答を変更できました - "400": + '400': description: 与えられた回答の情報が異なります - "403": + '403': description: 回答を変更する権限がありません - "404": + '404': description: アンケートの回答の期限がきれたため回答が存在しません - "405": + '405': description: 回答期限が過ぎたため回答できません - "500": + '500': description: responseIDを取得できませんでした delete: operationId: deleteResponse @@ -295,19 +295,19 @@ paths: #TODO 変数の命名を確認する - response description: 回答を削除します parameters: - - $ref: "#/components/parameters/responseIDInPath" + - $ref: '#/components/parameters/responseIDInPath' responses: - "200": + '200': description: 正常に回答を削除できました - "400": + '400': description: 与えられた回答の情報が異なります - "403": + '403': description: 回答を削除する権限がありません。 - "404": + '404': description: アンケートの回答の期限がきれたため回答が存在しません - "405": + '405': description: 回答期限が過ぎたため回答を削除できません - "500": + '500': description: responseIDを取得できませんでした /responses/myResponses: get: @@ -316,17 +316,17 @@ paths: #TODO 変数の命名を確認する - response description: 自分のすべての回答のリストを取得します。 parameters: - - $ref: "#/components/parameters/responseSortInQuery" + - $ref: '#/components/parameters/responseSortInQuery' responses: - "200": + '200': description: 正常に取得できました。回答の配列を返します。 content: application/json: schema: type: array items: - $ref: "#/components/schemas/Responses" - "500": + $ref: '#/components/schemas/Responses' + '500': description: 自分の回答のリストを取得できませんでした components: parameters: @@ -335,7 +335,7 @@ components: in: query description: 回答したもの(answered)か未回答のもの(unanswered)かを選別 schema: - $ref: "#/components/schemas/AnsweredType" + $ref: '#/components/schemas/AnsweredType' sortInQuery: name: sort in: query @@ -344,7 +344,7 @@ components: タイトルの降順 "-title", 更新日時が新しい "modified_at", 更新日時が古い "-modified_at" ) schema: - $ref: "#/components/schemas/SortType" + $ref: '#/components/schemas/SortType' responseSortInQuery: name: sort in: query @@ -353,7 +353,7 @@ components: タイトルの降順 "-title", 更新日時が新しい "modified_at", 更新日時が古い "-modified_at" ) schema: - $ref: "#/components/schemas/ResponseSortType" + $ref: '#/components/schemas/ResponseSortType' searchInQuery: name: search in: query @@ -475,38 +475,38 @@ components: NewQuestionnaire: allOf: - - $ref: "#/components/schemas/QuestionnaireTitle" - - $ref: "#/components/schemas/QuestionnaireDescription" - - $ref: "#/components/schemas/QuestionnaireResponseDueDateTime" - - $ref: "#/components/schemas/QuestionnaireResponseViewableBy" - - $ref: "#/components/schemas/QuestionnaireIsAnonymous" - - $ref: "#/components/schemas/QuestionnaireIsAllowingMultipleResponses" - - $ref: "#/components/schemas/QuestionnaireIsPublished" - - $ref: "#/components/schemas/QuestionnaireTargetsAndAdmins" + - $ref: '#/components/schemas/QuestionnaireTitle' + - $ref: '#/components/schemas/QuestionnaireDescription' + - $ref: '#/components/schemas/QuestionnaireResponseDueDateTime' + - $ref: '#/components/schemas/QuestionnaireResponseViewableBy' + - $ref: '#/components/schemas/QuestionnaireIsAnonymous' + - $ref: '#/components/schemas/QuestionnaireIsAllowingMultipleResponses' + - $ref: '#/components/schemas/QuestionnaireIsPublished' + - $ref: '#/components/schemas/QuestionnaireTargetsAndAdmins' - properties: questions: type: array items: - $ref: "#/components/schemas/NewQuestion" + $ref: '#/components/schemas/NewQuestion' required: - questions QuestionnaireDetail: allOf: - - $ref: "#/components/schemas/QuestionnaireID" - - $ref: "#/components/schemas/NewQuestionnaire" - - $ref: "#/components/schemas/QuestionnaireRespondents" - - $ref: "#/components/schemas/QuestionnaireCreatedAt" - - $ref: "#/components/schemas/QuestionnaireModifiedAt" + - $ref: '#/components/schemas/QuestionnaireID' + - $ref: '#/components/schemas/NewQuestionnaire' + - $ref: '#/components/schemas/QuestionnaireRespondents' + - $ref: '#/components/schemas/QuestionnaireCreatedAt' + - $ref: '#/components/schemas/QuestionnaireModifiedAt' QuestionnaireSummary: allOf: - - $ref: "#/components/schemas/QuestionnaireID" - - $ref: "#/components/schemas/QuestionnaireTitle" - - $ref: "#/components/schemas/QuestionnaireDescription" - - $ref: "#/components/schemas/QuestionnaireResponseDueDateTime" - - $ref: "#/components/schemas/QuestionnaireResponseViewableBy" - - $ref: "#/components/schemas/QuestionnaireIsAnonymous" - - $ref: "#/components/schemas/QuestionnaireIsAllowingMultipleResponses" - - $ref: "#/components/schemas/QuestionnaireIsPublished" + - $ref: '#/components/schemas/QuestionnaireID' + - $ref: '#/components/schemas/QuestionnaireTitle' + - $ref: '#/components/schemas/QuestionnaireDescription' + - $ref: '#/components/schemas/QuestionnaireResponseDueDateTime' + - $ref: '#/components/schemas/QuestionnaireResponseViewableBy' + - $ref: '#/components/schemas/QuestionnaireIsAnonymous' + - $ref: '#/components/schemas/QuestionnaireIsAllowingMultipleResponses' + - $ref: '#/components/schemas/QuestionnaireIsPublished' - properties: is_targeting_me: type: boolean @@ -544,7 +544,7 @@ components: questionnaires: type: array items: - $ref: "#/components/schemas/QuestionnaireSummary" + $ref: '#/components/schemas/QuestionnaireSummary' required: - page_max - questionnaires @@ -584,7 +584,7 @@ components: type: object properties: response_viewable_by: - $ref: "#/components/schemas/ResShareType" + $ref: '#/components/schemas/ResShareType' required: - response_viewable_by QuestionnaireIsAnonymous: @@ -637,9 +637,9 @@ components: type: object properties: targets: - $ref: "#/components/schemas/UsersAndGroups" + $ref: '#/components/schemas/UsersAndGroups' admins: - $ref: "#/components/schemas/UsersAndGroups" + $ref: '#/components/schemas/UsersAndGroups' required: - targets - admins @@ -647,7 +647,7 @@ components: type: object properties: respondents: - $ref: "#/components/schemas/Users" + $ref: '#/components/schemas/Users' required: - respondents QuestionnaireHasMyResponse: @@ -664,12 +664,12 @@ components: 自分に対するリマインドが有効かどうか。ユーザーが対象者でありかつ回答していない場合、この値がtrueであればリマインドが送信される。 NewQuestion: allOf: - - $ref: "#/components/schemas/QuestionBase" - - $ref: "#/components/schemas/QuestionSettingsByType" + - $ref: '#/components/schemas/QuestionBase' + - $ref: '#/components/schemas/QuestionSettingsByType' Question: allOf: - - $ref: "#/components/schemas/QuestionBase" - - $ref: "#/components/schemas/QuestionSettingsByType" + - $ref: '#/components/schemas/QuestionBase' + - $ref: '#/components/schemas/QuestionSettingsByType' - properties: questionID: type: integer @@ -683,7 +683,7 @@ components: Questions: type: array items: - $ref: "#/components/schemas/Question" + $ref: '#/components/schemas/Question' QuestionBase: type: object properties: @@ -704,15 +704,15 @@ components: - questionnaireID QuestionSettingsByType: oneOf: - - $ref: "#/components/schemas/QuestionSettingsText" - - $ref: "#/components/schemas/QuestionSettingsTextLong" - - $ref: "#/components/schemas/QuestionSettingsNumber" - - $ref: "#/components/schemas/QuestionSettingsSingleChoice" - - $ref: "#/components/schemas/QuestionSettingsMultipleChoice" - - $ref: "#/components/schemas/QuestionSettingsScale" + - $ref: '#/components/schemas/QuestionSettingsText' + - $ref: '#/components/schemas/QuestionSettingsTextLong' + - $ref: '#/components/schemas/QuestionSettingsNumber' + - $ref: '#/components/schemas/QuestionSettingsSingleChoice' + - $ref: '#/components/schemas/QuestionSettingsMultipleChoice' + - $ref: '#/components/schemas/QuestionSettingsScale' QuestionSettingsText: allOf: - - $ref: "#/components/schemas/QuestionTypeText" + - $ref: '#/components/schemas/QuestionTypeText' - type: object properties: maxLength: @@ -721,7 +721,7 @@ components: - maxLength QuestionSettingsTextLong: allOf: - - $ref: "#/components/schemas/QuestionTypeTextLong" + - $ref: '#/components/schemas/QuestionTypeTextLong' - type: object properties: maxLength: @@ -730,7 +730,7 @@ components: - maxLength QuestionSettingsNumber: allOf: - - $ref: "#/components/schemas/QuestionTypeNumber" + - $ref: '#/components/schemas/QuestionTypeNumber' - type: object properties: minValue: @@ -742,7 +742,7 @@ components: - maxValue QuestionSettingsSingleChoice: allOf: - - $ref: "#/components/schemas/QuestionTypeSingleChoice" + - $ref: '#/components/schemas/QuestionTypeSingleChoice' - type: object properties: options: @@ -753,7 +753,7 @@ components: - options QuestionSettingsMultipleChoice: allOf: - - $ref: "#/components/schemas/QuestionTypeMultipleChoice" + - $ref: '#/components/schemas/QuestionTypeMultipleChoice' - type: object properties: options: @@ -764,7 +764,7 @@ components: - options QuestionSettingsScale: allOf: - - $ref: "#/components/schemas/QuestionTypeScale" + - $ref: '#/components/schemas/QuestionTypeScale' - type: object properties: minValue: @@ -778,54 +778,50 @@ components: NewResponse: type: object properties: - respondent: - type: string - example: lolico is_draft: type: boolean example: true - submitted_at: - type: string - format: date-time - modified_at: - type: string - format: date-time body: type: array items: - $ref: "#/components/schemas/ResponseBody" + $ref: '#/components/schemas/ResponseBody' required: - - respondent - is_draft - - submitted_at - - modified_at - body Response: allOf: - - $ref: "#/components/schemas/QuestionnaireID" + - $ref: '#/components/schemas/QuestionnaireID' - type: object properties: responseID: type: integer example: 1 + submitted_at: + type: string + format: date-time + modified_at: + type: string + format: date-time required: - responseID - - $ref: "#/components/schemas/NewResponse" + - submitted_at + - modified_at + - $ref: '#/components/schemas/NewResponse' Responses: type: array items: - $ref: "#/components/schemas/Response" + $ref: '#/components/schemas/Response' ResponseBody: oneOf: - - $ref: "#/components/schemas/ResponseSettingsText" - - $ref: "#/components/schemas/ResponseSettingsTextLong" - - $ref: "#/components/schemas/ResponseSettingsNumber" - - $ref: "#/components/schemas/ResponseSettingsSingleChoice" - - $ref: "#/components/schemas/ResponseSettingsMultipleChoice" - - $ref: "#/components/schemas/ResponseSettingsScale" + - $ref: '#/components/schemas/ResponseSettingsText' + - $ref: '#/components/schemas/ResponseSettingsTextLong' + - $ref: '#/components/schemas/ResponseSettingsNumber' + - $ref: '#/components/schemas/ResponseSettingsSingleChoice' + - $ref: '#/components/schemas/ResponseSettingsMultipleChoice' + - $ref: '#/components/schemas/ResponseSettingsScale' ResponseSettingsText: allOf: - - $ref: "#/components/schemas/QuestionTypeText" + - $ref: '#/components/schemas/QuestionTypeText' - type: object properties: text: @@ -834,7 +830,7 @@ components: - text ResponseSettingsTextLong: allOf: - - $ref: "#/components/schemas/QuestionTypeTextLong" + - $ref: '#/components/schemas/QuestionTypeTextLong' - type: object properties: textLong: @@ -843,7 +839,7 @@ components: - textLong ResponseSettingsNumber: allOf: - - $ref: "#/components/schemas/QuestionTypeNumber" + - $ref: '#/components/schemas/QuestionTypeNumber' - type: object properties: number: @@ -852,7 +848,7 @@ components: - number ResponseSettingsSingleChoice: allOf: - - $ref: "#/components/schemas/QuestionTypeSingleChoice" + - $ref: '#/components/schemas/QuestionTypeSingleChoice' - type: object properties: index: @@ -863,7 +859,7 @@ components: - index ResponseSettingsMultipleChoice: allOf: - - $ref: "#/components/schemas/QuestionTypeMultipleChoice" + - $ref: '#/components/schemas/QuestionTypeMultipleChoice' - type: object properties: indexes: @@ -876,7 +872,7 @@ components: - indexes ResponseSettingsScale: allOf: - - $ref: "#/components/schemas/QuestionTypeScale" + - $ref: '#/components/schemas/QuestionTypeScale' - type: object properties: number: @@ -943,22 +939,22 @@ components: body: type: array items: - $ref: "#/components/schemas/ResultBody" + $ref: '#/components/schemas/ResultBody' required: - questionnaireID - responseCount - body ResultBody: oneOf: - - $ref: "#/components/schemas/ResultSettingsText" - - $ref: "#/components/schemas/ResultSettingsTextLong" - - $ref: "#/components/schemas/ResultSettingsNumber" - - $ref: "#/components/schemas/ResultSettingsSingleChoice" - - $ref: "#/components/schemas/ResultSettingsMultipleChoice" - - $ref: "#/components/schemas/ResultSettingsScale" + - $ref: '#/components/schemas/ResultSettingsText' + - $ref: '#/components/schemas/ResultSettingsTextLong' + - $ref: '#/components/schemas/ResultSettingsNumber' + - $ref: '#/components/schemas/ResultSettingsSingleChoice' + - $ref: '#/components/schemas/ResultSettingsMultipleChoice' + - $ref: '#/components/schemas/ResultSettingsScale' ResultSettingsText: allOf: - - $ref: "#/components/schemas/QuestionTypeText" + - $ref: '#/components/schemas/QuestionTypeText' - type: object properties: answers: @@ -971,7 +967,7 @@ components: - texts ResultSettingsTextLong: allOf: - - $ref: "#/components/schemas/QuestionTypeTextLong" + - $ref: '#/components/schemas/QuestionTypeTextLong' - type: object properties: answers: @@ -984,26 +980,26 @@ components: - textLongs ResultSettingsNumber: allOf: - - $ref: "#/components/schemas/QuestionTypeNumber" - - $ref: "#/components/schemas/ResultSettingsAnswerCountPerNumber" + - $ref: '#/components/schemas/QuestionTypeNumber' + - $ref: '#/components/schemas/ResultSettingsAnswerCountPerNumber' description: | 数値ごとの回答数の配列 ResultSettingsSingleChoice: allOf: - - $ref: "#/components/schemas/QuestionTypeSingleChoice" - - $ref: "#/components/schemas/ResultSettingsAnswerCountPerIndex" + - $ref: '#/components/schemas/QuestionTypeSingleChoice' + - $ref: '#/components/schemas/ResultSettingsAnswerCountPerIndex' description: | 選択肢ごとの回答数の配列 ResultSettingsMultipleChoice: allOf: - - $ref: "#/components/schemas/QuestionTypeMultipleChoice" - - $ref: "#/components/schemas/ResultSettingsAnswerCountPerIndex" + - $ref: '#/components/schemas/QuestionTypeMultipleChoice' + - $ref: '#/components/schemas/ResultSettingsAnswerCountPerIndex' description: | 選択肢ごとの回答数の配列 ResultSettingsScale: allOf: - - $ref: "#/components/schemas/QuestionTypeScale" - - $ref: "#/components/schemas/ResultSettingsAnswerCountPerNumber" + - $ref: '#/components/schemas/QuestionTypeScale' + - $ref: '#/components/schemas/ResultSettingsAnswerCountPerNumber' description: | 数値ごとの回答数の配列 ResultSettingsAnswerCountPerNumber: @@ -1044,9 +1040,9 @@ components: type: object properties: users: - $ref: "#/components/schemas/Users" + $ref: '#/components/schemas/Users' groups: - $ref: "#/components/schemas/Groups" + $ref: '#/components/schemas/Groups' required: - users - groups @@ -1069,8 +1065,8 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: "https://q.trap.jp/api/v3/oauth2/authorize" - tokenUrl: "https://q.trap.jp/api/v3/oauth2/token" + authorizationUrl: 'https://q.trap.jp/api/v3/oauth2/authorize' + tokenUrl: 'https://q.trap.jp/api/v3/oauth2/token' scopes: write: allows modifying resources read: allows reading resources From c81041bf518a36cd7817cfc2c1312682228b678d Mon Sep 17 00:00:00 2001 From: rei Date: Tue, 12 Dec 2023 21:28:34 +0900 Subject: [PATCH 36/43] =?UTF-8?q?[chore]=20swagger.yaml=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20formatter=E3=81=8C=E5=8A=B9=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=81=A0=E3=81=91=E3=81=AE=E8=99=9A=E7=84=A1=E3=82=B3=E3=83=9F?= =?UTF-8?q?=E3=83=83=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 358 +++++++++++++++++++------------------- 1 file changed, 179 insertions(+), 179 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 3b9bfeca..e418b704 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -1,8 +1,8 @@ openapi: 3.0.0 servers: - - url: 'https://anke-to.trap.jp/api' + - url: "https://anke-to.trap.jp/api" description: production - - url: 'http://localhost:8080/api' + - url: "http://localhost:8080/api" description: local info: title: anke-to API @@ -10,7 +10,7 @@ info: description: anke-to API contact: name: traP - url: 'https://github.com/traPtitech/anke-to' + url: "https://github.com/traPtitech/anke-to" security: - application: - read @@ -26,23 +26,23 @@ paths: #TODO 変数の命名を確認する - questionnaire description: 与えられた条件を満たす20件以下のアンケートのリストを取得します。 parameters: - - $ref: '#/components/parameters/sortInQuery' - - $ref: '#/components/parameters/searchInQuery' - - $ref: '#/components/parameters/pageInQuery' - - $ref: '#/components/parameters/onlyTargetingMeInQuery' - - $ref: '#/components/parameters/onlyAdministratedByMeInQuery' + - $ref: "#/components/parameters/sortInQuery" + - $ref: "#/components/parameters/searchInQuery" + - $ref: "#/components/parameters/pageInQuery" + - $ref: "#/components/parameters/onlyTargetingMeInQuery" + - $ref: "#/components/parameters/onlyAdministratedByMeInQuery" responses: - '200': + "200": description: 正常に取得できました。アンケートの配列を返します。 content: application/json: schema: - $ref: '#/components/schemas/QuestionnaireList' - '400': + $ref: "#/components/schemas/QuestionnaireList" + "400": description: 与えられた情報の形式が異なります - '500': + "500": description: アンケートを正常に取得できませんでした - '503': + "503": description: SQLの実行時間が3sを超えた場合。主に正規表現が原因。 post: operationId: postQuestionnaire @@ -54,17 +54,17 @@ paths: #TODO 変数の命名を確認する content: application/json: schema: - $ref: '#/components/schemas/NewQuestionnaire' + $ref: "#/components/schemas/NewQuestionnaire" responses: - '201': + "201": description: 正常にアンケートを作成できました。作成されたアンケートを返します。 content: application/json: schema: - $ref: '#/components/schemas/QuestionnaireDetail' - '400': + $ref: "#/components/schemas/QuestionnaireDetail" + "400": description: 与えられた情報の形式が異なります - '500': + "500": description: アンケートを正常に作成できませんでした /questionnaires/{questionnaireID}: get: @@ -73,19 +73,19 @@ paths: #TODO 変数の命名を確認する - questionnaire description: アンケートの情報を取得します。 parameters: - - $ref: '#/components/parameters/questionnaireIDInPath' + - $ref: "#/components/parameters/questionnaireIDInPath" responses: - '200': + "200": description: 正常に取得できました。 content: application/json: schema: - $ref: '#/components/schemas/QuestionnaireDetail' - '400': + $ref: "#/components/schemas/QuestionnaireDetail" + "400": description: アンケートのIDが無効です - '404': + "404": description: アンケートが存在しません - '500': + "500": description: アンケートを正常に取得できませんでした patch: operationId: editQuestionnaire @@ -93,19 +93,19 @@ paths: #TODO 変数の命名を確認する - questionnaire description: アンケートの情報を変更します。 parameters: - - $ref: '#/components/parameters/questionnaireIDInPath' + - $ref: "#/components/parameters/questionnaireIDInPath" requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/QuestionnaireDetail' + $ref: "#/components/schemas/QuestionnaireDetail" responses: - '200': + "200": description: 正常にアンケートを変更できました。 - '400': + "400": description: アンケートのIDが無効です - '500': + "500": description: 正常にアンケートを変更できませんでした delete: operationId: deleteQuestionnaire @@ -113,13 +113,13 @@ paths: #TODO 変数の命名を確認する - questionnaire description: アンケートを削除します。 parameters: - - $ref: '#/components/parameters/questionnaireIDInPath' + - $ref: "#/components/parameters/questionnaireIDInPath" responses: - '200': + "200": description: 正常にアンケートを削除できました。 - '400': + "400": description: アンケートのIDが無効です - '500': + "500": description: アンケートの削除ができませんでした /questionnaires/{questionnaireID}/myRemindStatus: get: @@ -128,19 +128,19 @@ paths: #TODO 変数の命名を確認する - questionnaire description: 自分に対するリマインドが有効かどうかを取得します。 parameters: - - $ref: '#/components/parameters/questionnaireIDInPath' + - $ref: "#/components/parameters/questionnaireIDInPath" responses: - '200': + "200": description: 正常に取得できました。 content: application/json: schema: - $ref: '#/components/schemas/QuestionnaireMyRemindStatus' - '400': + $ref: "#/components/schemas/QuestionnaireMyRemindStatus" + "400": description: アンケートのIDが無効です - '404': + "404": description: アンケートが存在しません - '500': + "500": description: リマインド設定を正常に取得できませんでした patch: operationId: editQuestionnaireMyRemindStatus @@ -148,21 +148,21 @@ paths: #TODO 変数の命名を確認する - questionnaire description: 自分に対するリマインドが有効かどうかを変更します。 parameters: - - $ref: '#/components/parameters/questionnaireIDInPath' + - $ref: "#/components/parameters/questionnaireIDInPath" requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/QuestionnaireMyRemindStatus' + $ref: "#/components/schemas/QuestionnaireMyRemindStatus" responses: - '200': + "200": description: 正常に変更できました。 - '400': + "400": description: アンケートのIDが無効です - '404': + "404": description: アンケートが存在しません - '500': + "500": description: リマインド設定を正常に変更できませんでした /questionnaires/{questionnaireID}/responses: get: @@ -171,23 +171,23 @@ paths: #TODO 変数の命名を確認する - questionnaire description: アンケートの全ての回答を取得します。アンケートが匿名回答の場合、取得できません。 parameters: - - $ref: '#/components/parameters/questionnaireIDInPath' - - $ref: '#/components/parameters/responseSortInQuery' - - $ref: '#/components/parameters/onlyMyResponseInQuery' + - $ref: "#/components/parameters/questionnaireIDInPath" + - $ref: "#/components/parameters/responseSortInQuery" + - $ref: "#/components/parameters/onlyMyResponseInQuery" responses: - '200': + "200": description: 正常に取得できました。 content: application/json: schema: - $ref: '#/components/schemas/Responses' - '400': + $ref: "#/components/schemas/Responses" + "400": description: アンケートのIDが無効です - '403': + "403": description: アンケートが匿名回答のため回答を取得できません - '404': + "404": description: アンケートが存在しません - '500': + "500": description: 回答を正常に取得できませんでした post: operationId: postQuestionnaireResponse @@ -195,27 +195,27 @@ paths: #TODO 変数の命名を確認する - questionnaire description: 新しい回答を作成します。アンケートが複数回答可能でない場合、過去の回答が削除されます。 parameters: - - $ref: '#/components/parameters/questionnaireIDInPath' + - $ref: "#/components/parameters/questionnaireIDInPath" requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/NewResponse' + $ref: "#/components/schemas/NewResponse" responses: - '201': + "201": description: 正常に回答を作成できました。作成された回答を返します。 content: application/json: schema: - $ref: '#/components/schemas/Response' - '400': + $ref: "#/components/schemas/Response" + "400": description: 与えられた情報の形式が異なります - '404': + "404": description: アンケートが存在しません - '422': + "422": description: 回答期限が過ぎたため回答できません - '500': + "500": description: 正常に回答が作成できませんでした /questionnaires/{questionnaireID}/result: get: @@ -224,21 +224,21 @@ paths: #TODO 変数の命名を確認する - questionnaire description: アンケートの回答を集計した結果を取得します。回答者の情報は含まれず、アンケートが匿名回答であっても取得できます。 parameters: - - $ref: '#/components/parameters/questionnaireIDInPath' + - $ref: "#/components/parameters/questionnaireIDInPath" responses: - '200': + "200": description: 正常に取得できました。 content: application/json: schema: - $ref: '#/components/schemas/Result' - '400': + $ref: "#/components/schemas/Result" + "400": description: アンケートのIDが無効です - '403': + "403": description: 結果を閲覧する権限がありません。 - '404': + "404": description: アンケートが存在しません - '500': + "500": description: アンケートの結果を正常に取得できませんでした /responses/{responseID}: get: @@ -247,21 +247,21 @@ paths: #TODO 変数の命名を確認する - response description: 回答を取得します。 parameters: - - $ref: '#/components/parameters/responseIDInPath' + - $ref: "#/components/parameters/responseIDInPath" responses: - '200': + "200": description: 正常に取得できました。 content: application/json: schema: - $ref: '#/components/schemas/Response' - '400': + $ref: "#/components/schemas/Response" + "400": description: responseIDが無効です - '403': + "403": description: 回答を閲覧する権限がありません。 - '404': + "404": description: 回答が存在しません - '500': + "500": description: 回答を正常に取得できませんでした patch: operationId: editResponse @@ -269,25 +269,25 @@ paths: #TODO 変数の命名を確認する - response description: 回答を変更します。 parameters: - - $ref: '#/components/parameters/responseIDInPath' + - $ref: "#/components/parameters/responseIDInPath" requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/Response' + $ref: "#/components/schemas/Response" responses: - '200': + "200": description: 正常に回答を変更できました - '400': + "400": description: 与えられた回答の情報が異なります - '403': + "403": description: 回答を変更する権限がありません - '404': + "404": description: アンケートの回答の期限がきれたため回答が存在しません - '405': + "405": description: 回答期限が過ぎたため回答できません - '500': + "500": description: responseIDを取得できませんでした delete: operationId: deleteResponse @@ -295,19 +295,19 @@ paths: #TODO 変数の命名を確認する - response description: 回答を削除します parameters: - - $ref: '#/components/parameters/responseIDInPath' + - $ref: "#/components/parameters/responseIDInPath" responses: - '200': + "200": description: 正常に回答を削除できました - '400': + "400": description: 与えられた回答の情報が異なります - '403': + "403": description: 回答を削除する権限がありません。 - '404': + "404": description: アンケートの回答の期限がきれたため回答が存在しません - '405': + "405": description: 回答期限が過ぎたため回答を削除できません - '500': + "500": description: responseIDを取得できませんでした /responses/myResponses: get: @@ -316,17 +316,17 @@ paths: #TODO 変数の命名を確認する - response description: 自分のすべての回答のリストを取得します。 parameters: - - $ref: '#/components/parameters/responseSortInQuery' + - $ref: "#/components/parameters/responseSortInQuery" responses: - '200': + "200": description: 正常に取得できました。回答の配列を返します。 content: application/json: schema: type: array items: - $ref: '#/components/schemas/Responses' - '500': + $ref: "#/components/schemas/Responses" + "500": description: 自分の回答のリストを取得できませんでした components: parameters: @@ -335,7 +335,7 @@ components: in: query description: 回答したもの(answered)か未回答のもの(unanswered)かを選別 schema: - $ref: '#/components/schemas/AnsweredType' + $ref: "#/components/schemas/AnsweredType" sortInQuery: name: sort in: query @@ -344,7 +344,7 @@ components: タイトルの降順 "-title", 更新日時が新しい "modified_at", 更新日時が古い "-modified_at" ) schema: - $ref: '#/components/schemas/SortType' + $ref: "#/components/schemas/SortType" responseSortInQuery: name: sort in: query @@ -353,7 +353,7 @@ components: タイトルの降順 "-title", 更新日時が新しい "modified_at", 更新日時が古い "-modified_at" ) schema: - $ref: '#/components/schemas/ResponseSortType' + $ref: "#/components/schemas/ResponseSortType" searchInQuery: name: search in: query @@ -475,38 +475,38 @@ components: NewQuestionnaire: allOf: - - $ref: '#/components/schemas/QuestionnaireTitle' - - $ref: '#/components/schemas/QuestionnaireDescription' - - $ref: '#/components/schemas/QuestionnaireResponseDueDateTime' - - $ref: '#/components/schemas/QuestionnaireResponseViewableBy' - - $ref: '#/components/schemas/QuestionnaireIsAnonymous' - - $ref: '#/components/schemas/QuestionnaireIsAllowingMultipleResponses' - - $ref: '#/components/schemas/QuestionnaireIsPublished' - - $ref: '#/components/schemas/QuestionnaireTargetsAndAdmins' + - $ref: "#/components/schemas/QuestionnaireTitle" + - $ref: "#/components/schemas/QuestionnaireDescription" + - $ref: "#/components/schemas/QuestionnaireResponseDueDateTime" + - $ref: "#/components/schemas/QuestionnaireResponseViewableBy" + - $ref: "#/components/schemas/QuestionnaireIsAnonymous" + - $ref: "#/components/schemas/QuestionnaireIsAllowingMultipleResponses" + - $ref: "#/components/schemas/QuestionnaireIsPublished" + - $ref: "#/components/schemas/QuestionnaireTargetsAndAdmins" - properties: questions: type: array items: - $ref: '#/components/schemas/NewQuestion' + $ref: "#/components/schemas/NewQuestion" required: - questions QuestionnaireDetail: allOf: - - $ref: '#/components/schemas/QuestionnaireID' - - $ref: '#/components/schemas/NewQuestionnaire' - - $ref: '#/components/schemas/QuestionnaireRespondents' - - $ref: '#/components/schemas/QuestionnaireCreatedAt' - - $ref: '#/components/schemas/QuestionnaireModifiedAt' + - $ref: "#/components/schemas/QuestionnaireID" + - $ref: "#/components/schemas/NewQuestionnaire" + - $ref: "#/components/schemas/QuestionnaireRespondents" + - $ref: "#/components/schemas/QuestionnaireCreatedAt" + - $ref: "#/components/schemas/QuestionnaireModifiedAt" QuestionnaireSummary: allOf: - - $ref: '#/components/schemas/QuestionnaireID' - - $ref: '#/components/schemas/QuestionnaireTitle' - - $ref: '#/components/schemas/QuestionnaireDescription' - - $ref: '#/components/schemas/QuestionnaireResponseDueDateTime' - - $ref: '#/components/schemas/QuestionnaireResponseViewableBy' - - $ref: '#/components/schemas/QuestionnaireIsAnonymous' - - $ref: '#/components/schemas/QuestionnaireIsAllowingMultipleResponses' - - $ref: '#/components/schemas/QuestionnaireIsPublished' + - $ref: "#/components/schemas/QuestionnaireID" + - $ref: "#/components/schemas/QuestionnaireTitle" + - $ref: "#/components/schemas/QuestionnaireDescription" + - $ref: "#/components/schemas/QuestionnaireResponseDueDateTime" + - $ref: "#/components/schemas/QuestionnaireResponseViewableBy" + - $ref: "#/components/schemas/QuestionnaireIsAnonymous" + - $ref: "#/components/schemas/QuestionnaireIsAllowingMultipleResponses" + - $ref: "#/components/schemas/QuestionnaireIsPublished" - properties: is_targeting_me: type: boolean @@ -544,7 +544,7 @@ components: questionnaires: type: array items: - $ref: '#/components/schemas/QuestionnaireSummary' + $ref: "#/components/schemas/QuestionnaireSummary" required: - page_max - questionnaires @@ -584,7 +584,7 @@ components: type: object properties: response_viewable_by: - $ref: '#/components/schemas/ResShareType' + $ref: "#/components/schemas/ResShareType" required: - response_viewable_by QuestionnaireIsAnonymous: @@ -637,9 +637,9 @@ components: type: object properties: targets: - $ref: '#/components/schemas/UsersAndGroups' + $ref: "#/components/schemas/UsersAndGroups" admins: - $ref: '#/components/schemas/UsersAndGroups' + $ref: "#/components/schemas/UsersAndGroups" required: - targets - admins @@ -647,7 +647,7 @@ components: type: object properties: respondents: - $ref: '#/components/schemas/Users' + $ref: "#/components/schemas/Users" required: - respondents QuestionnaireHasMyResponse: @@ -664,12 +664,12 @@ components: 自分に対するリマインドが有効かどうか。ユーザーが対象者でありかつ回答していない場合、この値がtrueであればリマインドが送信される。 NewQuestion: allOf: - - $ref: '#/components/schemas/QuestionBase' - - $ref: '#/components/schemas/QuestionSettingsByType' + - $ref: "#/components/schemas/QuestionBase" + - $ref: "#/components/schemas/QuestionSettingsByType" Question: allOf: - - $ref: '#/components/schemas/QuestionBase' - - $ref: '#/components/schemas/QuestionSettingsByType' + - $ref: "#/components/schemas/QuestionBase" + - $ref: "#/components/schemas/QuestionSettingsByType" - properties: questionID: type: integer @@ -683,7 +683,7 @@ components: Questions: type: array items: - $ref: '#/components/schemas/Question' + $ref: "#/components/schemas/Question" QuestionBase: type: object properties: @@ -704,15 +704,15 @@ components: - questionnaireID QuestionSettingsByType: oneOf: - - $ref: '#/components/schemas/QuestionSettingsText' - - $ref: '#/components/schemas/QuestionSettingsTextLong' - - $ref: '#/components/schemas/QuestionSettingsNumber' - - $ref: '#/components/schemas/QuestionSettingsSingleChoice' - - $ref: '#/components/schemas/QuestionSettingsMultipleChoice' - - $ref: '#/components/schemas/QuestionSettingsScale' + - $ref: "#/components/schemas/QuestionSettingsText" + - $ref: "#/components/schemas/QuestionSettingsTextLong" + - $ref: "#/components/schemas/QuestionSettingsNumber" + - $ref: "#/components/schemas/QuestionSettingsSingleChoice" + - $ref: "#/components/schemas/QuestionSettingsMultipleChoice" + - $ref: "#/components/schemas/QuestionSettingsScale" QuestionSettingsText: allOf: - - $ref: '#/components/schemas/QuestionTypeText' + - $ref: "#/components/schemas/QuestionTypeText" - type: object properties: maxLength: @@ -721,7 +721,7 @@ components: - maxLength QuestionSettingsTextLong: allOf: - - $ref: '#/components/schemas/QuestionTypeTextLong' + - $ref: "#/components/schemas/QuestionTypeTextLong" - type: object properties: maxLength: @@ -730,7 +730,7 @@ components: - maxLength QuestionSettingsNumber: allOf: - - $ref: '#/components/schemas/QuestionTypeNumber' + - $ref: "#/components/schemas/QuestionTypeNumber" - type: object properties: minValue: @@ -742,7 +742,7 @@ components: - maxValue QuestionSettingsSingleChoice: allOf: - - $ref: '#/components/schemas/QuestionTypeSingleChoice' + - $ref: "#/components/schemas/QuestionTypeSingleChoice" - type: object properties: options: @@ -753,7 +753,7 @@ components: - options QuestionSettingsMultipleChoice: allOf: - - $ref: '#/components/schemas/QuestionTypeMultipleChoice' + - $ref: "#/components/schemas/QuestionTypeMultipleChoice" - type: object properties: options: @@ -764,7 +764,7 @@ components: - options QuestionSettingsScale: allOf: - - $ref: '#/components/schemas/QuestionTypeScale' + - $ref: "#/components/schemas/QuestionTypeScale" - type: object properties: minValue: @@ -784,13 +784,13 @@ components: body: type: array items: - $ref: '#/components/schemas/ResponseBody' + $ref: "#/components/schemas/ResponseBody" required: - is_draft - body Response: allOf: - - $ref: '#/components/schemas/QuestionnaireID' + - $ref: "#/components/schemas/QuestionnaireID" - type: object properties: responseID: @@ -806,22 +806,22 @@ components: - responseID - submitted_at - modified_at - - $ref: '#/components/schemas/NewResponse' + - $ref: "#/components/schemas/NewResponse" Responses: type: array items: - $ref: '#/components/schemas/Response' + $ref: "#/components/schemas/Response" ResponseBody: oneOf: - - $ref: '#/components/schemas/ResponseSettingsText' - - $ref: '#/components/schemas/ResponseSettingsTextLong' - - $ref: '#/components/schemas/ResponseSettingsNumber' - - $ref: '#/components/schemas/ResponseSettingsSingleChoice' - - $ref: '#/components/schemas/ResponseSettingsMultipleChoice' - - $ref: '#/components/schemas/ResponseSettingsScale' + - $ref: "#/components/schemas/ResponseSettingsText" + - $ref: "#/components/schemas/ResponseSettingsTextLong" + - $ref: "#/components/schemas/ResponseSettingsNumber" + - $ref: "#/components/schemas/ResponseSettingsSingleChoice" + - $ref: "#/components/schemas/ResponseSettingsMultipleChoice" + - $ref: "#/components/schemas/ResponseSettingsScale" ResponseSettingsText: allOf: - - $ref: '#/components/schemas/QuestionTypeText' + - $ref: "#/components/schemas/QuestionTypeText" - type: object properties: text: @@ -830,7 +830,7 @@ components: - text ResponseSettingsTextLong: allOf: - - $ref: '#/components/schemas/QuestionTypeTextLong' + - $ref: "#/components/schemas/QuestionTypeTextLong" - type: object properties: textLong: @@ -839,7 +839,7 @@ components: - textLong ResponseSettingsNumber: allOf: - - $ref: '#/components/schemas/QuestionTypeNumber' + - $ref: "#/components/schemas/QuestionTypeNumber" - type: object properties: number: @@ -848,7 +848,7 @@ components: - number ResponseSettingsSingleChoice: allOf: - - $ref: '#/components/schemas/QuestionTypeSingleChoice' + - $ref: "#/components/schemas/QuestionTypeSingleChoice" - type: object properties: index: @@ -859,7 +859,7 @@ components: - index ResponseSettingsMultipleChoice: allOf: - - $ref: '#/components/schemas/QuestionTypeMultipleChoice' + - $ref: "#/components/schemas/QuestionTypeMultipleChoice" - type: object properties: indexes: @@ -872,7 +872,7 @@ components: - indexes ResponseSettingsScale: allOf: - - $ref: '#/components/schemas/QuestionTypeScale' + - $ref: "#/components/schemas/QuestionTypeScale" - type: object properties: number: @@ -939,22 +939,22 @@ components: body: type: array items: - $ref: '#/components/schemas/ResultBody' + $ref: "#/components/schemas/ResultBody" required: - questionnaireID - responseCount - body ResultBody: oneOf: - - $ref: '#/components/schemas/ResultSettingsText' - - $ref: '#/components/schemas/ResultSettingsTextLong' - - $ref: '#/components/schemas/ResultSettingsNumber' - - $ref: '#/components/schemas/ResultSettingsSingleChoice' - - $ref: '#/components/schemas/ResultSettingsMultipleChoice' - - $ref: '#/components/schemas/ResultSettingsScale' + - $ref: "#/components/schemas/ResultSettingsText" + - $ref: "#/components/schemas/ResultSettingsTextLong" + - $ref: "#/components/schemas/ResultSettingsNumber" + - $ref: "#/components/schemas/ResultSettingsSingleChoice" + - $ref: "#/components/schemas/ResultSettingsMultipleChoice" + - $ref: "#/components/schemas/ResultSettingsScale" ResultSettingsText: allOf: - - $ref: '#/components/schemas/QuestionTypeText' + - $ref: "#/components/schemas/QuestionTypeText" - type: object properties: answers: @@ -967,7 +967,7 @@ components: - texts ResultSettingsTextLong: allOf: - - $ref: '#/components/schemas/QuestionTypeTextLong' + - $ref: "#/components/schemas/QuestionTypeTextLong" - type: object properties: answers: @@ -980,26 +980,26 @@ components: - textLongs ResultSettingsNumber: allOf: - - $ref: '#/components/schemas/QuestionTypeNumber' - - $ref: '#/components/schemas/ResultSettingsAnswerCountPerNumber' + - $ref: "#/components/schemas/QuestionTypeNumber" + - $ref: "#/components/schemas/ResultSettingsAnswerCountPerNumber" description: | 数値ごとの回答数の配列 ResultSettingsSingleChoice: allOf: - - $ref: '#/components/schemas/QuestionTypeSingleChoice' - - $ref: '#/components/schemas/ResultSettingsAnswerCountPerIndex' + - $ref: "#/components/schemas/QuestionTypeSingleChoice" + - $ref: "#/components/schemas/ResultSettingsAnswerCountPerIndex" description: | 選択肢ごとの回答数の配列 ResultSettingsMultipleChoice: allOf: - - $ref: '#/components/schemas/QuestionTypeMultipleChoice' - - $ref: '#/components/schemas/ResultSettingsAnswerCountPerIndex' + - $ref: "#/components/schemas/QuestionTypeMultipleChoice" + - $ref: "#/components/schemas/ResultSettingsAnswerCountPerIndex" description: | 選択肢ごとの回答数の配列 ResultSettingsScale: allOf: - - $ref: '#/components/schemas/QuestionTypeScale' - - $ref: '#/components/schemas/ResultSettingsAnswerCountPerNumber' + - $ref: "#/components/schemas/QuestionTypeScale" + - $ref: "#/components/schemas/ResultSettingsAnswerCountPerNumber" description: | 数値ごとの回答数の配列 ResultSettingsAnswerCountPerNumber: @@ -1040,9 +1040,9 @@ components: type: object properties: users: - $ref: '#/components/schemas/Users' + $ref: "#/components/schemas/Users" groups: - $ref: '#/components/schemas/Groups' + $ref: "#/components/schemas/Groups" required: - users - groups @@ -1065,8 +1065,8 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: 'https://q.trap.jp/api/v3/oauth2/authorize' - tokenUrl: 'https://q.trap.jp/api/v3/oauth2/token' + authorizationUrl: "https://q.trap.jp/api/v3/oauth2/authorize" + tokenUrl: "https://q.trap.jp/api/v3/oauth2/token" scopes: write: allows modifying resources read: allows reading resources From bd6a691670701661a8baed45952033ffb038b8b1 Mon Sep 17 00:00:00 2001 From: rei Date: Tue, 12 Dec 2023 22:30:29 +0900 Subject: [PATCH 37/43] =?UTF-8?q?[chore]=20swagger.yaml=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20QuestionnaireIsRemindEnabled=E3=82=92object?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4=20QuestionnaireIsRemindEnabled?= =?UTF-8?q?=E3=81=AE=E5=91=BD=E5=90=8D=E3=82=92=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index e418b704..4664b863 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -135,7 +135,7 @@ paths: #TODO 変数の命名を確認する content: application/json: schema: - $ref: "#/components/schemas/QuestionnaireMyRemindStatus" + $ref: "#/components/schemas/QuestionnaireIsRemindEnabled" "400": description: アンケートのIDが無効です "404": @@ -154,7 +154,7 @@ paths: #TODO 変数の命名を確認する content: application/json: schema: - $ref: "#/components/schemas/QuestionnaireMyRemindStatus" + $ref: "#/components/schemas/QuestionnaireIsRemindEnabled" responses: "200": description: 正常に変更できました。 @@ -658,10 +658,15 @@ components: description: 回答済みあるいは下書きが存在する required: - has_response - QuestionnaireMyRemindStatus: - type: boolean - description: | - 自分に対するリマインドが有効かどうか。ユーザーが対象者でありかつ回答していない場合、この値がtrueであればリマインドが送信される。 + QuestionnaireIsRemindEnabled: + type: object + properties: + is_remind_enabled: + type: boolean + description: | + 自分に対するリマインドが有効かどうか。ユーザーが対象者でありかつ回答していない場合、この値がtrueであればリマインドが送信される。 + required: + - is_remind_enabled NewQuestion: allOf: - $ref: "#/components/schemas/QuestionBase" From 0e9c09edf3a23341c312e989eeb7a93131a8c5e5 Mon Sep 17 00:00:00 2001 From: rei Date: Tue, 12 Dec 2023 22:59:12 +0900 Subject: [PATCH 38/43] =?UTF-8?q?[chore]=20swagger.yaml=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20properties=E3=82=92snake=5Fcase=E3=81=AB=E7=B5=B1?= =?UTF-8?q?=E4=B8=80=20required=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 69 +++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 4664b863..71d24a44 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -551,11 +551,11 @@ components: QuestionnaireID: type: object properties: - questionnaireID: + questionnaire_id: type: integer example: 1 required: - - questionnaireID + - questionnaire_id QuestionnaireTitle: type: object properties: @@ -676,14 +676,14 @@ components: - $ref: "#/components/schemas/QuestionBase" - $ref: "#/components/schemas/QuestionSettingsByType" - properties: - questionID: + question_id: type: integer example: 1 created_at: type: string format: date-time required: - - questionID + - question_id - created_at Questions: type: array @@ -692,7 +692,7 @@ components: QuestionBase: type: object properties: - questionnaireID: + questionnaire_id: type: integer example: 1 title: @@ -702,11 +702,10 @@ components: is_required: type: boolean required: - - questionType + - questionnaire_id - title - description - is_required - - questionnaireID QuestionSettingsByType: oneOf: - $ref: "#/components/schemas/QuestionSettingsText" @@ -798,7 +797,7 @@ components: - $ref: "#/components/schemas/QuestionnaireID" - type: object properties: - responseID: + response_id: type: integer example: 1 submitted_at: @@ -808,7 +807,7 @@ components: type: string format: date-time required: - - responseID + - response_id - submitted_at - modified_at - $ref: "#/components/schemas/NewResponse" @@ -887,58 +886,58 @@ components: QuestionTypeText: type: object properties: - questionType: + question_type: type: string enum: [Text] required: - - questionType + - question_type QuestionTypeTextLong: type: object properties: - questionType: + question_type: type: string enum: [TextLong] required: - - questionType + - question_type QuestionTypeNumber: type: object properties: - questionType: + question_type: type: string enum: [Number] required: - - questionType + - question_type QuestionTypeSingleChoice: type: object properties: - questionType: + question_type: type: string enum: [SingleChoice] required: - - questionType + - question_type QuestionTypeMultipleChoice: type: object properties: - questionType: + question_type: type: string enum: [MultipleChoice] required: - - questionType + - question_type QuestionTypeScale: type: object properties: - questionType: + question_type: type: string enum: [Scale] required: - - questionType + - question_type Result: type: object properties: - questionnaireID: + questionnaire_id: type: integer example: 1 - responseCount: + response_count: type: integer example: 1 body: @@ -946,8 +945,8 @@ components: items: $ref: "#/components/schemas/ResultBody" required: - - questionnaireID - - responseCount + - questionnaire_id + - response_count - body ResultBody: oneOf: @@ -969,7 +968,7 @@ components: description: | 回答文の配列 required: - - texts + - answers ResultSettingsTextLong: allOf: - $ref: "#/components/schemas/QuestionTypeTextLong" @@ -982,7 +981,7 @@ components: description: | 回答文の配列 required: - - textLongs + - answers ResultSettingsNumber: allOf: - $ref: "#/components/schemas/QuestionTypeNumber" @@ -1010,37 +1009,37 @@ components: ResultSettingsAnswerCountPerNumber: type: object properties: - answerCountPerNumber: #TODO: 配列なのに複数形じゃないの気になる + answer_count_per_number: #TODO: 配列なのに複数形じゃないの気になる type: array items: type: object properties: number: type: number - answerCount: + answer_count: type: number required: - number - - answerCount + - answer_count required: - - indexes + - answer_count_per_number ResultSettingsAnswerCountPerIndex: type: object properties: - AnswerCountPerIndex: #TODO: 配列なのに複数形じゃないの気になるv2 + answer_count_per_index: #TODO: 配列なのに複数形じゃないの気になるv2 type: array items: type: object properties: index: type: number - answerCount: + answer_count: type: number required: - index - - answerCount + - answer_count required: - - indexes + - answer_count_per_index UsersAndGroups: type: object properties: From 553790e67eee043a08c1ab10d10f0b693ae9fb87 Mon Sep 17 00:00:00 2001 From: rei Date: Tue, 12 Dec 2023 23:02:29 +0900 Subject: [PATCH 39/43] =?UTF-8?q?[chore]=20swagger.yaml=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20answer=5Fcounts=5Fper=5Findex=E3=81=ABproperty?= =?UTF-8?q?=E5=90=8D=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 71d24a44..357e567b 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -1009,7 +1009,7 @@ components: ResultSettingsAnswerCountPerNumber: type: object properties: - answer_count_per_number: #TODO: 配列なのに複数形じゃないの気になる + answer_counts_per_number: type: array items: type: object @@ -1026,7 +1026,7 @@ components: ResultSettingsAnswerCountPerIndex: type: object properties: - answer_count_per_index: #TODO: 配列なのに複数形じゃないの気になるv2 + answer_counts_per_index: type: array items: type: object From 0ba240e9e4095acfd75246794b053464fa096cb0 Mon Sep 17 00:00:00 2001 From: rei Date: Tue, 12 Dec 2023 23:03:26 +0900 Subject: [PATCH 40/43] =?UTF-8?q?[chore]=20swagger.yaml=20=E5=89=8D?= =?UTF-8?q?=E3=82=B3=E3=83=9F=E3=83=83=E3=83=88=E3=81=A7=E3=81=AErequired?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 357e567b..364cebc6 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -1022,7 +1022,7 @@ components: - number - answer_count required: - - answer_count_per_number + - answer_counts_per_number ResultSettingsAnswerCountPerIndex: type: object properties: @@ -1039,7 +1039,7 @@ components: - index - answer_count required: - - answer_count_per_index + - answer_counts_per_index UsersAndGroups: type: object properties: From fd9076632b273b2dc13cc3f4f49e26a1c65619a3 Mon Sep 17 00:00:00 2001 From: rei Date: Tue, 12 Dec 2023 23:12:23 +0900 Subject: [PATCH 41/43] =?UTF-8?q?[chore]=20swagger.yaml=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20ResultSettingsAnswerCountPer=E3=81=AB=E9=96=A2?= =?UTF-8?q?=E3=81=99=E3=82=8B=E7=B4=B0=E3=81=8B=E3=81=AA=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=AA=E3=81=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 364cebc6..d89a9568 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -15,10 +15,10 @@ security: - application: - read - write -tags: +tags: # TODO: リソースの分類でつけなおす - name: questionnaire - name: response -paths: #TODO 変数の命名を確認する +paths: # TODO 変数の命名を確認する /questionnaires: # TODO: 取得個数可変でもいいかも get: operationId: getQuestionnaires @@ -419,7 +419,7 @@ components: traQ ID(ex:mazrean) schema: type: string - schemas: # TODO: description, example, requiredを確認する + schemas: # TODO: description, exampleを確認する AnsweredType: type: string description: アンケート検索時に回答済みかの状態での絞り込み @@ -965,8 +965,8 @@ components: type: array items: type: string - description: | - 回答文の配列 + description: | + 回答文の配列 required: - answers ResultSettingsTextLong: @@ -978,35 +978,35 @@ components: type: array items: type: string - description: | - 回答文の配列 + description: | + 回答文の配列 required: - answers ResultSettingsNumber: allOf: - $ref: "#/components/schemas/QuestionTypeNumber" - - $ref: "#/components/schemas/ResultSettingsAnswerCountPerNumber" + - $ref: "#/components/schemas/ResultSettingsAnswerCountsPerNumber" description: | 数値ごとの回答数の配列 ResultSettingsSingleChoice: allOf: - $ref: "#/components/schemas/QuestionTypeSingleChoice" - - $ref: "#/components/schemas/ResultSettingsAnswerCountPerIndex" + - $ref: "#/components/schemas/ResultSettingsAnswerCountsPerIndex" description: | 選択肢ごとの回答数の配列 ResultSettingsMultipleChoice: allOf: - $ref: "#/components/schemas/QuestionTypeMultipleChoice" - - $ref: "#/components/schemas/ResultSettingsAnswerCountPerIndex" + - $ref: "#/components/schemas/ResultSettingsAnswerCountsPerIndex" description: | 選択肢ごとの回答数の配列 ResultSettingsScale: allOf: - $ref: "#/components/schemas/QuestionTypeScale" - - $ref: "#/components/schemas/ResultSettingsAnswerCountPerNumber" + - $ref: "#/components/schemas/ResultSettingsAnswerCountsPerNumber" description: | 数値ごとの回答数の配列 - ResultSettingsAnswerCountPerNumber: + ResultSettingsAnswerCountsPerNumber: type: object properties: answer_counts_per_number: @@ -1023,7 +1023,7 @@ components: - answer_count required: - answer_counts_per_number - ResultSettingsAnswerCountPerIndex: + ResultSettingsAnswerCountsPerIndex: type: object properties: answer_counts_per_index: From e06e7e2d272a6d1efa08a015129352d7a99127e1 Mon Sep 17 00:00:00 2001 From: rei <107461411+reiroop@users.noreply.github.com> Date: Tue, 12 Dec 2023 23:18:36 +0900 Subject: [PATCH 42/43] Update docs/swagger/swagger.yaml Co-authored-by: cp20 <47262658+cp-20@users.noreply.github.com> --- docs/swagger/swagger.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index d89a9568..9b7d35ca 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -778,7 +778,6 @@ components: required: - minValue - maxValue - NewResponse: type: object properties: From 144dc2b0678743bd4e66ac3bce4cb081334eb4b7 Mon Sep 17 00:00:00 2001 From: rei Date: Tue, 12 Dec 2023 23:58:58 +0900 Subject: [PATCH 43/43] =?UTF-8?q?[chore]=20swagger.yaml=20maxLength,=20min?= =?UTF-8?q?Value,=20maxLength=E3=82=92required=E3=81=8B=E3=82=89=E5=A4=96?= =?UTF-8?q?=E3=81=97=E3=80=81snake=5Fcase=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger/swagger.yaml | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 9b7d35ca..e1d05654 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -719,31 +719,24 @@ components: - $ref: "#/components/schemas/QuestionTypeText" - type: object properties: - maxLength: + max_length: type: integer - required: - - maxLength QuestionSettingsTextLong: allOf: - $ref: "#/components/schemas/QuestionTypeTextLong" - type: object properties: - maxLength: + max_length: type: number - required: - - maxLength QuestionSettingsNumber: allOf: - $ref: "#/components/schemas/QuestionTypeNumber" - type: object properties: - minValue: + min_value: type: integer - maxValue: + max_value: type: integer - required: - - minValue - - maxValue QuestionSettingsSingleChoice: allOf: - $ref: "#/components/schemas/QuestionTypeSingleChoice" @@ -771,13 +764,13 @@ components: - $ref: "#/components/schemas/QuestionTypeScale" - type: object properties: - minValue: + min_value: type: integer - maxValue: + max_value: type: integer required: - - minValue - - maxValue + - min_value + - max_value NewResponse: type: object properties: