-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from su-its/docs/api-spec
feat:API定義を行いました
- Loading branch information
Showing
1 changed file
with
203 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Typing API | ||
version: 1.0.0 | ||
servers: | ||
- url: http://localhost:8080 | ||
description: ローカル開発環境 | ||
- url: https://typemaster.com | ||
description: 本番環境 | ||
paths: | ||
/users: | ||
post: | ||
summary: 新しいユーザーを作成 | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
MailAdress: | ||
type: string | ||
maxLength: 255 | ||
HandleName: | ||
type: string | ||
maxLength: 36 | ||
Name: | ||
type: string | ||
maxLength: 36 | ||
HashedPassword: | ||
type: string | ||
maxLength: 255 | ||
Department: | ||
type: string | ||
enum: [CS, BI, IA] | ||
responses: | ||
'201': | ||
description: ユーザー作成成功 | ||
'400': | ||
description: 不正なリクエスト | ||
/users/{userId}: | ||
get: | ||
summary: ユーザー情報を取得 | ||
parameters: | ||
- in: path | ||
name: userId | ||
required: true | ||
schema: | ||
type: string | ||
responses: | ||
'200': | ||
description: ユーザー情報取得成功 | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/User' | ||
'404': | ||
description: ユーザーが見つからない | ||
/users/{userId}/scores: | ||
post: | ||
summary: ユーザーのスコアを登録 | ||
parameters: | ||
- in: path | ||
name: userId | ||
required: true | ||
schema: | ||
type: string | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
keystrokes: | ||
type: integer | ||
accuracy: | ||
type: number | ||
format: float | ||
score: | ||
type: number | ||
format: float | ||
startedAt: | ||
type: string | ||
format: date-time | ||
endedAt: | ||
type: string | ||
format: date-time | ||
responses: | ||
'201': | ||
description: スコア登録成功 | ||
'400': | ||
description: 不正なリクエスト | ||
/users/{userId}/scores/{scoreId}: | ||
get: | ||
summary: 特定のスコア情報の取得 | ||
parameters: | ||
- in: path | ||
name: userId | ||
required: true | ||
schema: | ||
type: string | ||
- in: path | ||
name: scoreId | ||
required: true | ||
schema: | ||
type: string | ||
responses: | ||
'200': | ||
description: スコア情報の取得成功 | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Score' | ||
'404': | ||
description: スコアが見つからない | ||
|
||
put: | ||
summary: ユーザーのスコアを更新 | ||
parameters: | ||
- in: path | ||
name: userId | ||
required: true | ||
schema: | ||
type: string | ||
- in: path | ||
name: scoreId | ||
required: true | ||
schema: | ||
type: string | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
keystrokes: | ||
type: integer | ||
accuracy: | ||
type: number | ||
format: float | ||
score: | ||
type: number | ||
format: float | ||
startedAt: | ||
type: string | ||
format: date-time | ||
endedAt: | ||
type: string | ||
format: date-time | ||
responses: | ||
'200': | ||
description: スコアの更新成功 | ||
'400': | ||
description: 不正なリクエスト | ||
'404': | ||
description: スコアが見つからない | ||
components: | ||
schemas: | ||
User: | ||
type: object | ||
properties: | ||
id: | ||
type: string | ||
format: uuid | ||
MailAdress: | ||
type: string | ||
HandleName: | ||
type: string | ||
Name: | ||
type: string | ||
HashedPassword: | ||
type: string | ||
Department: | ||
type: string | ||
enum: [CS, BI, IA] | ||
created_at: | ||
type: string | ||
format: date-time | ||
updated_at: | ||
type: string | ||
format: date-time | ||
Score: | ||
type: object | ||
properties: | ||
id: | ||
type: string | ||
format: uuid | ||
keystrokes: | ||
type: integer | ||
accuracy: | ||
type: number | ||
format: float | ||
score: | ||
type: number | ||
format: float | ||
startedAt: | ||
type: string | ||
format: date-time | ||
endedAt: | ||
type: string | ||
format: date-time |