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"