Add /token endpoint
This commit is contained in:
37
openapi.yml
37
openapi.yml
@ -33,6 +33,24 @@ paths:
|
|||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/HelloResponse"
|
$ref: "#/components/schemas/HelloResponse"
|
||||||
|
/token:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- session
|
||||||
|
summary: Create a bearer token
|
||||||
|
operationId: createToken
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/CreateSessionRequest"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: "New token was generated"
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/CreateSessionResponse"
|
||||||
|
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
@ -42,6 +60,25 @@ components:
|
|||||||
value:
|
value:
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
CreateSessionRequest:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- username
|
||||||
|
- password
|
||||||
|
properties:
|
||||||
|
username:
|
||||||
|
type: string
|
||||||
|
password:
|
||||||
|
type: string
|
||||||
|
|
||||||
|
CreateSessionResponse:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- token
|
||||||
|
properties:
|
||||||
|
token:
|
||||||
|
type: string
|
||||||
|
|
||||||
ErrorResponse:
|
ErrorResponse:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
|
Reference in New Issue
Block a user