openapi: add session endpoints
This commit is contained in:
parent
894851c0e8
commit
8da1c9346b
83
openapi.yaml
83
openapi.yaml
@ -6,6 +6,8 @@ info:
|
|||||||
servers:
|
servers:
|
||||||
- url: https://submissions.strafes.net/v1
|
- url: https://submissions.strafes.net/v1
|
||||||
tags:
|
tags:
|
||||||
|
- name: Session
|
||||||
|
description: Session operations
|
||||||
- name: Submissions
|
- name: Submissions
|
||||||
description: Submission operations
|
description: Submission operations
|
||||||
- name: Scripts
|
- name: Scripts
|
||||||
@ -15,6 +17,63 @@ tags:
|
|||||||
security:
|
security:
|
||||||
- cookieAuth: []
|
- cookieAuth: []
|
||||||
paths:
|
paths:
|
||||||
|
/session/user:
|
||||||
|
get:
|
||||||
|
summary: Get information about the currently logged in user
|
||||||
|
operationId: sessionUser
|
||||||
|
tags:
|
||||||
|
- Session
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Successful response
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/User"
|
||||||
|
default:
|
||||||
|
description: General Error
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/Error"
|
||||||
|
/session/roles:
|
||||||
|
get:
|
||||||
|
summary: Get list of roles for the current session
|
||||||
|
operationId: sessionRoles
|
||||||
|
tags:
|
||||||
|
- Session
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Successful response
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/Roles"
|
||||||
|
default:
|
||||||
|
description: General Error
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/Error"
|
||||||
|
/session/validate:
|
||||||
|
get:
|
||||||
|
summary: Ask if the current session is valid
|
||||||
|
operationId: sessionValidate
|
||||||
|
tags:
|
||||||
|
- Session
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Successful response
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
default:
|
||||||
|
description: General Error
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/Error"
|
||||||
/submissions:
|
/submissions:
|
||||||
get:
|
get:
|
||||||
summary: Get list of submissions
|
summary: Get list of submissions
|
||||||
@ -619,6 +678,30 @@ components:
|
|||||||
ID:
|
ID:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
|
Roles:
|
||||||
|
required:
|
||||||
|
- Roles
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
Roles:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
User:
|
||||||
|
required:
|
||||||
|
- UserID
|
||||||
|
- Username
|
||||||
|
- AvatarURL
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
UserID:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
Username:
|
||||||
|
type: string
|
||||||
|
maxLength: 128
|
||||||
|
AvatarURL:
|
||||||
|
type: string
|
||||||
|
maxLength: 256
|
||||||
Submission:
|
Submission:
|
||||||
required:
|
required:
|
||||||
- ID
|
- ID
|
||||||
|
Loading…
x
Reference in New Issue
Block a user