source: TFP-WebServer/WebServer/src/WebAPI/APIs/Permissions/Blacklist.openapi.yaml@ 472

Last change on this file since 472 was 462, checked in by alloc, 15 months ago

More OpenAPI specs added

File size: 4.4 KB
RevLine 
[460]1openapi: 3.1.0
2info:
3 title: Blacklist
4 version: '1'
5
6components:
7 schemas:
8 BlacklistElement:
9 type: object
10 properties:
11 name:
12 type: string
13 examples:
14 - TheFunPimp
15 description: Name of the banned player for display purposes. Can be empty.
16 userId:
17 $ref: './openapi.yaml#/components/schemas/TypeUserIdObject'
18 bannedUntil:
19 type: string
20 format: date-time
21 banReason:
22 type: string
23 examples:
24 - Cheating not allowed!
25 required:
26 - name
27 - userId
28 - bannedUntil
29 - banReason
30
31 BlacklistList:
32 type: array
33 items:
34 $ref: '#/components/schemas/BlacklistElement'
35
36
37 requestBodies:
38 BlacklistBodyIn:
39 content:
40 application/json:
41 schema:
42 type: object
43 properties:
[462]44 bannedUntil:
45 type: string
46 format: date-time
47 banReason:
48 type: string
[460]49 examples:
[462]50 - Cheating not allowed!
51 name:
[460]52 type: string
53 examples:
[462]54 - TheFunPimp
[460]55 required:
[462]56 - bannedUntil
[460]57 required: true
58
59
60paths:
61 /api/blacklist:
62 get:
63 tags:
64 - Permissions
65 summary: Blacklist list
66 description: Fetch a list of all blacklisted users
67 operationId: blacklist.get
68 responses:
69 200:
[462]70 description: List of blacklist entries
[460]71 content:
72 application/json:
73 schema:
74 type: object
75 properties:
76 data:
77 $ref: '#/components/schemas/BlacklistList'
78 meta:
79 $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
80 required:
81 - data
82 - meta
[462]83 403:
84 $ref: './openapi.yaml#/components/responses/Unauthorized'
85 security:
86 - apiTokenName: [ ]
87 apiTokenSecret: [ ]
88 - sessionCookie: [ ]
[460]89
90
91 /api/blacklist/{id}:
92# get:
93# tags:
94# - Permissions
95# summary: Marker show
96# description: Fetch a single defined map marker
97# operationId: blacklist.get.id
98# parameters:
99# - $ref: '#/components/parameters/MarkerIdParameter'
100# responses:
101# 200:
102# description: Single found marker
103# $ref: '#/components/responses/MarkersBodyOut'
104# 404:
105# description: Marker ID not found, errorCode will be 'ID_NOT_FOUND'
106# $ref: '#/components/responses/HttpEmptyEnvelopedResponse'
107
108 post:
109 tags:
110 - Permissions
111 summary: Blacklist create
112 description: Create or update a blacklist entry
113 operationId: blacklist.post.id
114 parameters:
[462]115 - $ref: './openapi.yaml#/components/parameters/UserIdPathParameter'
[460]116 requestBody:
117 $ref: '#/components/requestBodies/BlacklistBodyIn'
118 responses:
119 201:
[462]120 description: Blacklist entry created or updated
[460]121 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
122 400:
[462]123 description: Invalid request body, errorCode will be 'NO_OR_INVALID_BANNED_UNTIL'
[460]124 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
125 403:
126 $ref: './openapi.yaml#/components/responses/Unauthorized'
127 security:
128 - apiTokenName: []
129 apiTokenSecret: []
130 - sessionCookie: []
131
132 delete:
133 tags:
134 - Permissions
135 summary: Blacklist delete
136 description: Delete a single entry from the blacklist
137 operationId: blacklist.delete.id
138 parameters:
[462]139 - $ref: './openapi.yaml#/components/parameters/UserIdPathParameter'
[460]140 responses:
141 204:
[462]142 description: Deleted blacklist entry
[460]143 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
144 404:
[462]145 description: User ID not found
[460]146 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
147 403:
148 $ref: './openapi.yaml#/components/responses/Unauthorized'
149 security:
150 - apiTokenName: []
151 apiTokenSecret: []
152 - sessionCookie: []
Note: See TracBrowser for help on using the repository browser.