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

Last change on this file since 460 was 460, checked in by alloc, 2 years ago

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

File size: 4.0 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
115 responses:
116 HttpEmptyEnvelopedResponse:
117 description: Empty result
118 content:
119 application/json:
120 schema:
121 type: object
122 properties:
123 data:
124 type: array
125 items:
126 type: 'null'
127 maxItems: 0
128 examples:
129 - []
130 meta:
131 $ref: '#/components/schemas/ResultEnvelopeMeta'
132 required:
133 - data
134 - meta
135
136 Unauthorized:
137 description: Not authorized to call this operation
138
139
140 securitySchemes:
141 apiTokenName:
142 type: apiKey
143 in: header
144 name: X-SDTD-API-TOKENNAME
145 description: Authentication by a "WebToken" with token name and token secret, passed in as header fields. This specifies the token name.
146 apiTokenSecret:
147 type: apiKey
148 in: header
149 name: X-SDTD-API-SECRET
150 description: Authentication by a "WebToken" with token name and token secret, passed in as header fields. This specifies the token secret.
151 sessionCookie:
152 type: apiKey
153 in: cookie
154 name: sid
155 description: Authentication by session cookie. A cookie can be received from the session endpoints.
156
157
158paths:
Note: See TracBrowser for help on using the repository browser.