Merge pull request #5801 from Atry/fix-login-openapi

fix: properly document `/users/login`
This commit is contained in:
Lauri Ojansivu 2025-06-12 15:43:09 +03:00 committed by GitHub
commit 6fed9e73d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 86 additions and 54 deletions

View file

@ -932,47 +932,63 @@ 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: | description: Login credentials
Your username schema:
type: string type: object
- name: password required:
in: formData - username
required: true - password
description: | properties:
Your password username:
type: string description: |
format: password Your username
type: string
password:
description: |
Your password
type: string
format: password
responses: responses:
200: 200:
description: |- description: |-
Successful authentication Successful authentication
schema: schema:
items: type: object
properties: required:
id: - id
type: string - token
token: - tokenExpires
type: string properties:
tokenExpires: id:
type: string type: string
description: User ID
token:
type: string
description: |
Authentication token
tokenExpires:
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:
description: | description: |
Error in authentication Error in authentication

View file

@ -31,47 +31,63 @@ 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: | description: Login credentials
Your username schema:
type: string type: object
- name: password required:
in: formData - username
required: true - password
description: | properties:
Your password username:
type: string type: string
format: password description: |
Your username
password:
type: string
format: password
description: |
Your password
responses: responses:
200: 200:
description: |- description: |-
Successful authentication Successful authentication
schema: schema:
items: type: object
properties: required:
id: - id
type: string - token
token: - tokenExpires
type: string properties:
tokenExpires: id:
type: string type: string
description: User ID
token:
type: string
description: |
Authentication token
tokenExpires:
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:
description: | description: |
Error in authentication Error in authentication