fix: properly document /users/login

This commit is contained in:
Yang, Bo 2025-06-12 01:30:43 +00:00
parent 7bf75b1ff7
commit e14a3f9c2d
2 changed files with 86 additions and 54 deletions

View file

@ -932,20 +932,26 @@ paths:
operationId: login operationId: login
summary: Login with REST API summary: Login with REST API
consumes: consumes:
- application/x-www-form-urlencoded
- application/json - application/json
- application/x-www-form-urlencoded
tags: tags:
- Login - Login
parameters: parameters:
- name: username - name: loginRequest
in: formData in: body
required: true required: true
description: Login credentials
schema:
type: object
required:
- username
- password
properties:
username:
description: | description: |
Your username Your username
type: string type: string
- name: password password:
in: formData
required: true
description: | description: |
Your password Your password
type: string type: string
@ -955,22 +961,32 @@ paths:
description: |- description: |-
Successful authentication Successful authentication
schema: schema:
items: type: object
required:
- id
- token
- tokenExpires
properties: properties:
id: id:
type: string type: string
description: User ID
token: token:
type: string type: string
description: |
Authentication token
tokenExpires: tokenExpires:
type: string type: string
format: date-time
description: |
Token expiration date
400: 400:
description: | description: |
Error in authentication Error in authentication
schema: schema:
items: type: object
properties: properties:
error: error:
type: number type: string
reason: reason:
type: string type: string
default: default:

View file

@ -31,45 +31,61 @@ paths:
operationId: login operationId: login
summary: Login with REST API summary: Login with REST API
consumes: consumes:
- application/x-www-form-urlencoded
- application/json - application/json
- application/x-www-form-urlencoded
tags: tags:
- Login - Login
parameters: parameters:
- name: username - name: loginRequest
in: formData in: body
required: true required: true
description: Login credentials
schema:
type: object
required:
- username
- password
properties:
username:
type: string
description: | description: |
Your username Your username
type: string password:
- name: password
in: formData
required: true
description: |
Your password
type: string type: string
format: password format: password
description: |
Your password
responses: responses:
200: 200:
description: |- description: |-
Successful authentication Successful authentication
schema: schema:
items: type: object
required:
- id
- token
- tokenExpires
properties: properties:
id: id:
type: string type: string
description: User ID
token: token:
type: string type: string
description: |
Authentication token
tokenExpires: tokenExpires:
type: string type: string
format: date-time
description: |
Token expiration date
400: 400:
description: | description: |
Error in authentication Error in authentication
schema: schema:
items: type: object
properties: properties:
error: error:
type: number type: string
reason: reason:
type: string type: string
default: default: