Skip to content

Commit

Permalink
docs: 自身のユーザー情報が取得できるエンドポイントの定義
Browse files Browse the repository at this point in the history
  • Loading branch information
rito528 committed Nov 1, 2023
1 parent 1de265b commit 9c155e2
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions schema/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ security:
tags:
- name: forms
description: フォーム操作に関連するAPI
- name: users
description: ユーザー操作に関連するAPI

paths:
/forms:
Expand All @@ -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"
18 changes: 18 additions & 0 deletions schema/paths/users/index.yml
Original file line number Diff line number Diff line change
@@ -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"
9 changes: 9 additions & 0 deletions schema/types/users/components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions schema/types/users/definitions.yml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 9c155e2

Please sign in to comment.