-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
shunsei
committed
Sep 30, 2024
1 parent
7262628
commit b6505a1
Showing
4 changed files
with
87 additions
and
3 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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
request: | ||
value: | ||
name: "比企谷八幡" | ||
email: "hikigaya@oregairu.com" | ||
password: "password" | ||
|
||
response: | ||
value: | ||
id: 1 | ||
name: "比企谷八幡" | ||
email: "hikigaya@oregairu.com" | ||
passwordDigest: "d41d8cd98f00b204e9800998ecf8427e" |
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
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
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 |
---|---|---|
@@ -1,2 +1,72 @@ | ||
login: | ||
|
||
post: | ||
tags: | ||
- auth | ||
operationId: login | ||
summary: ログインする | ||
description: セッションIDをCookieに保存する | ||
security: [] | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
email: | ||
type: string | ||
format: email | ||
password: | ||
type: string | ||
format: password | ||
example: | ||
email: "username@example.com" | ||
password: "password" | ||
responses: | ||
'200': | ||
description: > | ||
ログインに成功した. | ||
`session_token`という名前のCookieにセッションIDが保存される. | ||
以降のリクエストにはこのCookieを含める必要がある. | ||
headers: | ||
Set-Cookie: | ||
schema: | ||
type: string | ||
example: session_token=abcde12345; Path=/; HttpOnly | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "../components/schemas/user.yml#/response" | ||
examples: | ||
user: | ||
$ref: "../components/examples/user.yml#/response" | ||
'500': | ||
$ref: "../components/responses/5xx.yml#/InternalServerError" | ||
|
||
logout: | ||
delete: | ||
tags: | ||
- auth | ||
operationId: logout | ||
summary: ログアウトする | ||
description: CookieからセッションIDを削除する | ||
security: [] | ||
responses: | ||
'204': | ||
description: ログアウトに成功した | ||
headers: | ||
Set-Cookie: | ||
schema: | ||
type: string | ||
example: session_token=; Path=/; Max-Age=0 | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "../components/schemas/response.yml" | ||
example: | ||
code: 204 | ||
message: "No Content" | ||
'401': | ||
$ref: "../components/responses/4xx.yml#/Unauthorized" | ||
'500': | ||
$ref: "../components/responses/5xx.yml#/InternalServerError" |