Last change
on this file since 474 was 463, checked in by alloc, 16 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.4 KB
|
Line | |
---|
1 | openapi: 3.1.0
|
---|
2 | info:
|
---|
3 | title: Player
|
---|
4 | version: '1'
|
---|
5 |
|
---|
6 | components:
|
---|
7 | schemas:
|
---|
8 | PlayerElement:
|
---|
9 | type: object
|
---|
10 | properties:
|
---|
11 | entityId:
|
---|
12 | $ref: './openapi.yaml#/components/schemas/TypeEntityId'
|
---|
13 | name:
|
---|
14 | type: string
|
---|
15 | platformId:
|
---|
16 | $ref: './openapi.yaml#/components/schemas/TypeUserIdObject'
|
---|
17 | crossplatformId:
|
---|
18 | $ref: './openapi.yaml#/components/schemas/TypeUserIdObject'
|
---|
19 | totalPlayTimeSeconds:
|
---|
20 | type: 'null'
|
---|
21 | lastOnline:
|
---|
22 | type: 'null'
|
---|
23 | online:
|
---|
24 | type: boolean
|
---|
25 | const: true
|
---|
26 | ip:
|
---|
27 | type:
|
---|
28 | - string
|
---|
29 | - 'null'
|
---|
30 | ping:
|
---|
31 | type:
|
---|
32 | - integer
|
---|
33 | - 'null'
|
---|
34 | position:
|
---|
35 | oneOf:
|
---|
36 | - $ref: './openapi.yaml#/components/schemas/TypeVector3i'
|
---|
37 | - type: 'null'
|
---|
38 | level:
|
---|
39 | type: 'null'
|
---|
40 | health:
|
---|
41 | type: integer
|
---|
42 | stamina:
|
---|
43 | type: number
|
---|
44 | format: float
|
---|
45 | score:
|
---|
46 | type: integer
|
---|
47 | deaths:
|
---|
48 | type: integer
|
---|
49 | kills:
|
---|
50 | type: object
|
---|
51 | properties:
|
---|
52 | zombies:
|
---|
53 | type: integer
|
---|
54 | players:
|
---|
55 | type: integer
|
---|
56 | required:
|
---|
57 | - zombies
|
---|
58 | - players
|
---|
59 | banned:
|
---|
60 | type: object
|
---|
61 | properties:
|
---|
62 | banActive:
|
---|
63 | type: boolean
|
---|
64 | reason:
|
---|
65 | type:
|
---|
66 | - string
|
---|
67 | - 'null'
|
---|
68 | until:
|
---|
69 | oneOf:
|
---|
70 | - type: string
|
---|
71 | format: date-time
|
---|
72 | - type: 'null'
|
---|
73 | required:
|
---|
74 | - banActive
|
---|
75 | - reason
|
---|
76 | - until
|
---|
77 | required:
|
---|
78 | - entityId
|
---|
79 | - name
|
---|
80 | - platformId
|
---|
81 | - crossplatformId
|
---|
82 | - totalPlayTimeSeconds
|
---|
83 | - lastOnline
|
---|
84 | - online
|
---|
85 | - ip
|
---|
86 | - ping
|
---|
87 | - position
|
---|
88 | - level
|
---|
89 | - health
|
---|
90 | - stamina
|
---|
91 | - score
|
---|
92 | - deaths
|
---|
93 | - kills
|
---|
94 | - banned
|
---|
95 |
|
---|
96 | PlayerResultObject:
|
---|
97 | type: object
|
---|
98 | properties:
|
---|
99 | players:
|
---|
100 | type: array
|
---|
101 | items:
|
---|
102 | $ref: '#/components/schemas/PlayerElement'
|
---|
103 | required:
|
---|
104 | - players
|
---|
105 |
|
---|
106 |
|
---|
107 | parameters:
|
---|
108 | EntityIdParameter:
|
---|
109 | name: id
|
---|
110 | in: path
|
---|
111 | required: true
|
---|
112 | schema:
|
---|
113 | $ref: './openapi.yaml#/components/schemas/TypeEntityId'
|
---|
114 |
|
---|
115 |
|
---|
116 | paths:
|
---|
117 | /api/player:
|
---|
118 | get:
|
---|
119 | tags:
|
---|
120 | - WorldState
|
---|
121 | summary: Players list
|
---|
122 | description: Fetch a list of the currently online players. This is restricted to the player of the logged in user when the logged in user does not have the permission to view all players.
|
---|
123 | operationId: Player.get
|
---|
124 | responses:
|
---|
125 | 200:
|
---|
126 | description: List of players
|
---|
127 | content:
|
---|
128 | application/json:
|
---|
129 | schema:
|
---|
130 | type: object
|
---|
131 | properties:
|
---|
132 | data:
|
---|
133 | $ref: '#/components/schemas/PlayerResultObject'
|
---|
134 | meta:
|
---|
135 | $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
|
---|
136 | required:
|
---|
137 | - data
|
---|
138 | - meta
|
---|
139 | security:
|
---|
140 | - {}
|
---|
141 | - apiTokenName: [ ]
|
---|
142 | apiTokenSecret: [ ]
|
---|
143 | - sessionCookie: [ ]
|
---|
144 |
|
---|
145 | /api/player/{id}:
|
---|
146 | get:
|
---|
147 | tags:
|
---|
148 | - WorldState
|
---|
149 | summary: Player get
|
---|
150 | description: Fetch the player specified by the given EntityID
|
---|
151 | operationId: Player.get.id
|
---|
152 | parameters:
|
---|
153 | - $ref: '#/components/parameters/EntityIdParameter'
|
---|
154 | responses:
|
---|
155 | 200:
|
---|
156 | description: Player
|
---|
157 | content:
|
---|
158 | application/json:
|
---|
159 | schema:
|
---|
160 | type: object
|
---|
161 | properties:
|
---|
162 | data:
|
---|
163 | $ref: '#/components/schemas/PlayerResultObject'
|
---|
164 | meta:
|
---|
165 | $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
|
---|
166 | required:
|
---|
167 | - data
|
---|
168 | - meta
|
---|
169 | 404:
|
---|
170 | description: EntityID not found
|
---|
171 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
172 | security:
|
---|
173 | - {}
|
---|
174 | - apiTokenName: [ ]
|
---|
175 | apiTokenSecret: [ ]
|
---|
176 | - sessionCookie: [ ]
|
---|
Note:
See
TracBrowser
for help on using the repository browser.