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

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

More OpenAPI specs added
OpenAPI specs cleanup to have everything validate fine
Added CORS support to API endpoints

File size: 4.5 KB
Line 
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:
44 x:
45 type: integer
46 examples:
47 - -43
48 y:
49 type: integer
50 examples:
51 - 842
52 icon:
53 type: string
54 format: uuid
55 examples:
56 - https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Blue_question_mark_icon.svg/1200px-Blue_question_mark_icon.svg.png
57 required:
58 - x
59 - y
60 required: true
61
62
63 parameters:
64 UserIdPathParameter:
65 name: id
66 in: path
67 required: true
68 schema:
69 $ref: '#/components/schemas/TypeUserIdString'
70
71
72paths:
73 /api/blacklist:
74 get:
75 tags:
76 - Permissions
77 summary: Blacklist list
78 description: Fetch a list of all blacklisted users
79 operationId: blacklist.get
80 responses:
81 200:
82 description: List of found markers
83 content:
84 application/json:
85 schema:
86 type: object
87 properties:
88 data:
89 $ref: '#/components/schemas/BlacklistList'
90 meta:
91 $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
92 required:
93 - data
94 - meta
95
96
97 /api/blacklist/{id}:
98# get:
99# tags:
100# - Permissions
101# summary: Marker show
102# description: Fetch a single defined map marker
103# operationId: blacklist.get.id
104# parameters:
105# - $ref: '#/components/parameters/MarkerIdParameter'
106# responses:
107# 200:
108# description: Single found marker
109# $ref: '#/components/responses/MarkersBodyOut'
110# 404:
111# description: Marker ID not found, errorCode will be 'ID_NOT_FOUND'
112# $ref: '#/components/responses/HttpEmptyEnvelopedResponse'
113
114 post:
115 tags:
116 - Permissions
117 summary: Blacklist create
118 description: Create or update a blacklist entry
119 operationId: blacklist.post.id
120 parameters:
121 - $ref: '#/components/parameters/UserIdPathParameter'
122 requestBody:
123 $ref: '#/components/requestBodies/BlacklistBodyIn'
124 responses:
125 201:
126 description: Marker with updated values
127 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
128 400:
129 description: >-
130 Invalid request body, errorCode will be one of 'NO_OR_INVALID_X',
131 'NO_OR_INVALID_Y'
132 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
133 403:
134 $ref: './openapi.yaml#/components/responses/Unauthorized'
135 security:
136 - apiTokenName: []
137 apiTokenSecret: []
138 - sessionCookie: []
139
140 delete:
141 tags:
142 - Permissions
143 summary: Blacklist delete
144 description: Delete a single entry from the blacklist
145 operationId: blacklist.delete.id
146 parameters:
147 - $ref: '#/components/parameters/UserIdPathParameter'
148 responses:
149 204:
150 description: Deleted marker
151 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
152 404:
153 description: Marker ID not found
154 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
155 403:
156 $ref: './openapi.yaml#/components/responses/Unauthorized'
157 security:
158 - apiTokenName: []
159 apiTokenSecret: []
160 - sessionCookie: []
Note: See TracBrowser for help on using the repository browser.