From 9c155e290b721ef9a051a89e700a52dfef9d4d6b Mon Sep 17 00:00:00 2001 From: rito528 <39003544+rito528@users.noreply.github.com> Date: Wed, 1 Nov 2023 23:03:33 +0900 Subject: [PATCH 1/3] =?UTF-8?q?docs:=20=E8=87=AA=E8=BA=AB=E3=81=AE?= =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E6=83=85=E5=A0=B1=E3=81=8C?= =?UTF-8?q?=E5=8F=96=E5=BE=97=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=A8=E3=83=B3?= =?UTF-8?q?=E3=83=89=E3=83=9D=E3=82=A4=E3=83=B3=E3=83=88=E3=81=AE=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- schema/openapi.yml | 4 ++++ schema/paths/users/index.yml | 18 ++++++++++++++++++ schema/types/users/components.yml | 9 +++++++++ schema/types/users/definitions.yml | 11 +++++++++++ 4 files changed, 42 insertions(+) create mode 100644 schema/paths/users/index.yml create mode 100644 schema/types/users/definitions.yml diff --git a/schema/openapi.yml b/schema/openapi.yml index 0fa3133..075872f 100644 --- a/schema/openapi.yml +++ b/schema/openapi.yml @@ -25,6 +25,8 @@ security: tags: - name: forms description: フォーム操作に関連するAPI + - name: users + description: ユーザー操作に関連するAPI paths: /forms: @@ -43,3 +45,5 @@ paths: $ref: "./paths/forms/answers/comment/index.yml" /forms/labels: $ref: "./paths/forms/labels/index.yml" + /users: + $ref: "./paths/users/index.yml" diff --git a/schema/paths/users/index.yml b/schema/paths/users/index.yml new file mode 100644 index 0000000..94fd4fd --- /dev/null +++ b/schema/paths/users/index.yml @@ -0,0 +1,18 @@ +get: + tags: + - users + operationId: getUserInfo + description: | + Bearer TokenにMicrosoftから取得したトークンを含めて実行すると + 自身のユーザー情報が帰ってきます + responses: + "200": + description: 自身のユーザー情報の取得成功 + content: + application/json: + schema: + $ref: "../../types/users/definitions.yml#/definitions/user" + "401": + $ref: "../../errors/errorResponses.yml#/components/responses/unauthorized" + "500": + $ref: "../../errors/errorResponses.yml#/components/responses/internalServerError" diff --git a/schema/types/users/components.yml b/schema/types/users/components.yml index 4c51f09..0616105 100644 --- a/schema/types/users/components.yml +++ b/schema/types/users/components.yml @@ -4,3 +4,12 @@ components: description: Minecraftプレイヤーに紐づくUUID type: string format: uuid + name: + description: Minecraftプレイヤー名 + type: string + role: + description: ユーザー権限 + type: string + enum: + - ADMINISTRATOR + - STANDARD_USER diff --git a/schema/types/users/definitions.yml b/schema/types/users/definitions.yml new file mode 100644 index 0000000..14810c0 --- /dev/null +++ b/schema/types/users/definitions.yml @@ -0,0 +1,11 @@ +definitions: + user: + description: ユーザー + type: object + properties: + uuid: + $ref: "./components.yml#/components/schemas/uuid" + name: + $ref: "./components.yml#/components/schemas/name" + role: + $ref: "./components.yml#/components/schemas/role" From 11562aaa8a0090c590d2291093156d5637609bc2 Mon Sep 17 00:00:00 2001 From: rito528 <39003544+rito528@users.noreply.github.com> Date: Wed, 1 Nov 2023 23:13:30 +0900 Subject: [PATCH 2/3] =?UTF-8?q?docs:=20=E3=83=A6=E3=83=BC=E3=82=B6?= =?UTF-8?q?=E6=83=85=E5=A0=B1=E3=81=AE=E5=A4=89=E6=9B=B4=E3=82=92=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=82=8B=E3=82=A8=E3=83=B3=E3=83=89=E3=83=9D=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=81=AE=E5=AE=9A=E7=BE=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- schema/openapi.yml | 2 ++ schema/paths/users/[uuid]/index.yml | 21 +++++++++++++++++++++ schema/types/users/parameters.yml | 15 +++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 schema/paths/users/[uuid]/index.yml create mode 100644 schema/types/users/parameters.yml diff --git a/schema/openapi.yml b/schema/openapi.yml index 075872f..4a13385 100644 --- a/schema/openapi.yml +++ b/schema/openapi.yml @@ -47,3 +47,5 @@ paths: $ref: "./paths/forms/labels/index.yml" /users: $ref: "./paths/users/index.yml" + /users/{uuid}: + $ref: "./paths/users/[uuid]/index.yml" diff --git a/schema/paths/users/[uuid]/index.yml b/schema/paths/users/[uuid]/index.yml new file mode 100644 index 0000000..2327b2a --- /dev/null +++ b/schema/paths/users/[uuid]/index.yml @@ -0,0 +1,21 @@ +patch: + tags: + - users + operationId: updateUser + summary: ユーザー情報を変更する + parameters: + - $ref: "../../../types/users/parameters.yml#/parameters/uuid" + - $ref: "../../../types/users/parameters.yml#/parameters/role" + responses: + "200": + description: ユーザー情報の変更に成功 + "400": + $ref: "../../../errors/errorResponses.yml#/components/responses/syntaxError" + "401": + $ref: "../../../errors/errorResponses.yml#/components/responses/unauthorized" + "403": + $ref: "../../../errors/errorResponses.yml#/components/responses/forbidden" + "404": + $ref: "../../../errors/errorResponses.yml#/components/responses/notFound" + "500": + $ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError" diff --git a/schema/types/users/parameters.yml b/schema/types/users/parameters.yml new file mode 100644 index 0000000..c9b2dc0 --- /dev/null +++ b/schema/types/users/parameters.yml @@ -0,0 +1,15 @@ +parameters: + uuid: + name: uuid + in: path + description: プレイヤーUUID + required: true + schema: + $ref: "./components.yml#/components/schemas/uuid" + role: + name: role + in: query + description: ユーザー権限 + required: false + schema: + $ref: "./components.yml#/components/schemas/role" From 70d5a080124912e9b946b09ada1e4a8d21d6835e Mon Sep 17 00:00:00 2001 From: rito528 <39003544+rito528@users.noreply.github.com> Date: Wed, 1 Nov 2023 23:32:32 +0900 Subject: [PATCH 3/3] =?UTF-8?q?docs:=20=E3=81=99=E3=81=B9=E3=81=A6?= =?UTF-8?q?=E3=81=AE=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E6=83=85=E5=A0=B1?= =?UTF-8?q?=E3=82=92=E5=8F=96=E5=BE=97=E3=81=99=E3=82=8B=E3=82=A8=E3=83=B3?= =?UTF-8?q?=E3=83=89=E3=83=9D=E3=82=A4=E3=83=B3=E3=83=88=E3=81=AE=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- schema/openapi.yml | 2 ++ schema/paths/users/index.yml | 1 + schema/paths/users/list/index.yml | 23 +++++++++++++++++++++++ schema/types/users/definitions.yml | 7 +++++++ 4 files changed, 33 insertions(+) create mode 100644 schema/paths/users/list/index.yml diff --git a/schema/openapi.yml b/schema/openapi.yml index 4a13385..3d7501e 100644 --- a/schema/openapi.yml +++ b/schema/openapi.yml @@ -49,3 +49,5 @@ paths: $ref: "./paths/users/index.yml" /users/{uuid}: $ref: "./paths/users/[uuid]/index.yml" + /users/list: + $ref: "./paths/users/list/index.yml" diff --git a/schema/paths/users/index.yml b/schema/paths/users/index.yml index 94fd4fd..51f49be 100644 --- a/schema/paths/users/index.yml +++ b/schema/paths/users/index.yml @@ -2,6 +2,7 @@ get: tags: - users operationId: getUserInfo + summary: 自身のユーザー情報の取得 description: | Bearer TokenにMicrosoftから取得したトークンを含めて実行すると 自身のユーザー情報が帰ってきます diff --git a/schema/paths/users/list/index.yml b/schema/paths/users/list/index.yml new file mode 100644 index 0000000..4ba95e7 --- /dev/null +++ b/schema/paths/users/list/index.yml @@ -0,0 +1,23 @@ +get: + tags: + - users + operationId: getUsersList + summary: すべてのユーザーの取得 + description: ユーザーリストを返します + responses: + "200": + description: 自身のユーザー情報の取得成功 + content: + application/json: + schema: + $ref: "../../../types/users/definitions.yml#/definitions/users" + "400": + $ref: "../../../errors/errorResponses.yml#/components/responses/syntaxError" + "401": + $ref: "../../../errors/errorResponses.yml#/components/responses/unauthorized" + "403": + $ref: "../../../errors/errorResponses.yml#/components/responses/forbidden" + "404": + $ref: "../../../errors/errorResponses.yml#/components/responses/notFound" + "500": + $ref: "../../../errors/errorResponses.yml#/components/responses/internalServerError" diff --git a/schema/types/users/definitions.yml b/schema/types/users/definitions.yml index 14810c0..b09eaef 100644 --- a/schema/types/users/definitions.yml +++ b/schema/types/users/definitions.yml @@ -9,3 +9,10 @@ definitions: $ref: "./components.yml#/components/schemas/name" role: $ref: "./components.yml#/components/schemas/role" + users: + description: ユーザーの配列 + type: array + uniqueItems: true + minItems: 0 + items: + $ref: "#/definitions/user"