api: add session delete api doc

This commit is contained in:
Muyao CHEN 2024-10-13 22:22:44 +02:00
parent 544ccbe1ca
commit 2fe834fe55

View File

@ -76,7 +76,6 @@ paths:
/session/create: /session/create:
post: post:
tags: tags:
- user
- session - session
description: Create a new session for a user description: Create a new session for a user
requestBody: requestBody:
@ -85,6 +84,41 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/SessionCreateRequest' $ref: '#/components/schemas/SessionCreateRequest'
responses:
'200':
description: Successful operation
content:
application/json:
schema:
type: object
properties:
token:
type: string
example: fakjshdflauhkjhsometokenakjsdhfaksj
'400':
description: Client side error
content:
application/json:
schema:
type: object
properties:
code:
type: string
example: AuthFailure
message:
type: string
example: "wrong email password."
'500':
description: Server side error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrResponse'
/session/delete:
post:
tags:
- session
description: Delete an existing session for a user
responses: responses:
'200': '200':
description: Successful operation description: Successful operation
@ -110,13 +144,15 @@ paths:
example: AuthFailure example: AuthFailure
message: message:
type: string type: string
example: "wrong email password." example: "user not logged in."
'500': '500':
description: Server side error description: Server side error
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ErrResponse' $ref: '#/components/schemas/ErrResponse'
security:
- jwt: []
components: components:
schemas: schemas:
@ -161,3 +197,9 @@ components:
message: message:
type: string type: string
example: "Server internal error." example: "Server internal error."
securitySchemes:
jwt:
name: Bearer authentication
type: http
bearerFormat: "JWT"
scheme: bearer