source: TFP-WebServer/WebServer/src/WebAPI/OpenAPI.master.yaml@ 485

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

21.1.16.0 release
Completed OpenAPI specs
Add support to path handlers to register OpenAPI specs
Fixed ItemIconHandler throwing error when requested path contains no dot

File size: 4.6 KB
Line 
1openapi: 3.1.0
2info:
3 title: 7 Days To Die WebAPI
4 version: '1.0.0'
5servers:
6 - url: /
7
8components:
9 schemas:
10 ResultEnvelopeMeta:
11 type: object
12 properties:
13 serverTime:
14 type: string
15 format: date-time
16 requestMethod:
17 type: string
18 examples:
19 - GET
20 - POST
21 requestSubpath:
22 type: string
23 examples:
24 - search
25 description: >-
26 URL path (without query arguments) starting from after the API name,
27 excluding the initial slash '/'
28 requestBody:
29 type:
30 - object
31 - 'null'
32 examples:
33 - id: a
34 filter: 123
35 description: If erroneous request had a valid JSON body it is included here
36 errorCode:
37 type: string
38 examples:
39 - GET_WITH_BODY
40 - INVALID_COMMAND
41 description: Custom error identifier
42 exceptionMessage:
43 type: string
44 description: Message (If API execution threw an exception)
45 exceptionTrace:
46 type: string
47 description: Stack trace (If API execution threw an exception)
48 required:
49 - serverTime
50 - requestMethod
51 - requestSubpath
52 - requestBody
53 - errorCode
54
55 TypeEntityId:
56 type: integer
57 minimum: 0
58 examples:
59 - 171
60 description: World-unique EntityID
61
62 TypeVector3i:
63 type: object
64 properties:
65 x:
66 type: integer
67 examples:
68 - -123
69 y:
70 type: integer
71 examples:
72 - 61
73 z:
74 type: integer
75 examples:
76 - 734
77 required:
78 - x
79 - 'y'
80 - z
81 description: 3D vector in full blocks
82
83 TypeUserIdString:
84 type: string
85 pattern: '^\[a-zA-Z]+_[\w]+$'
86 examples:
87 - 'Steam_76561198021925107'
88 description: User ID including platform
89
90 TypeUserIdObject:
91 anyOf:
92 - type: object
93 properties:
94 combinedString:
95 $ref: '#/components/schemas/TypeUserIdString'
96 platformId:
97 type: string
98 examples:
99 - Steam
100 - XBL
101 description: Gaming platform the ID references
102 userId:
103 type: string
104 examples:
105 - '76561198021925107'
106 description: Unique ID of the user within the given gaming platform
107 required:
108 - combinedString
109 - platformId
110 - userId
111 description: User ID
112 - type: 'null'
113
114 TypeGameTimeObject:
115 type: object
116 properties:
117 days:
118 type: integer
119 minimum: 1
120 hours:
121 type: integer
122 minimum: 0
123 maximum: 23
124 minutes:
125 type: integer
126 minimum: 0
127 maximum: 59
128 required:
129 - days
130 - hours
131 - minutes
132
133
134 parameters:
135 UserIdPathParameter:
136 name: id
137 in: path
138 required: true
139 schema:
140 $ref: '#/components/schemas/TypeUserIdString'
141
142
143 responses:
144 HttpEmptyEnvelopedResponse:
145 description: Empty result
146 content:
147 application/json:
148 schema:
149 type: object
150 properties:
151 data:
152 type: array
153 items:
154 type: 'null'
155 maxItems: 0
156 examples:
157 - []
158 meta:
159 $ref: '#/components/schemas/ResultEnvelopeMeta'
160 required:
161 - data
162 - meta
163
164 Unauthorized:
165 description: Not authorized to call this operation
166
167
168 securitySchemes:
169 apiTokenName:
170 type: apiKey
171 in: header
172 name: X-SDTD-API-TOKENNAME
173 description: Authentication by a "WebToken" with token name and token secret, passed in as header fields. This specifies the token name.
174 apiTokenSecret:
175 type: apiKey
176 in: header
177 name: X-SDTD-API-SECRET
178 description: Authentication by a "WebToken" with token name and token secret, passed in as header fields. This specifies the token secret.
179 sessionCookie:
180 type: apiKey
181 in: cookie
182 name: sid
183 description: Authentication by session cookie. A cookie can be received from the session endpoints.
184
185
186paths:
Note: See TracBrowser for help on using the repository browser.