Add /token endpoint
This commit is contained in:
37
openapi.yml
37
openapi.yml
@ -33,6 +33,24 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$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:
|
||||
schemas:
|
||||
@ -42,6 +60,25 @@ components:
|
||||
value:
|
||||
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:
|
||||
type: object
|
||||
required:
|
||||
|
Reference in New Issue
Block a user