comparison mod_rest/openapi.yaml @ 4476:125279f4a5b8

mod_rest: Restructure API spec To make referencing individual fields easier, apparently some things don't like references to individual properties of an object.
author Kim Alvefur <zash@zash.se>
date Sun, 28 Feb 2021 18:55:18 +0100
parents 949db0714b5f
children 8df6cc648963
comparison
equal deleted inserted replaced
4475:017ad6ed96ae 4476:125279f4a5b8
65 components: 65 components:
66 schemas: 66 schemas:
67 stanza: 67 stanza:
68 properties: 68 properties:
69 delay: 69 delay:
70 type: string 70 $ref: '#/components/schemas/delay'
71 description: Timestamp of when a stanza was delayed, in ISO 8601 / XEP-0082
72 format.
73 state: 71 state:
74 enum: 72 $ref: '#/components/schemas/state'
75 - active 73 type:
76 - inactive 74 $ref: '#/components/schemas/type'
77 - gone 75 status:
78 - composing 76 $ref: '#/components/schemas/status'
79 - paused 77 id:
80 description: Chat state notifications, e.g. "is typing..." 78 $ref: '#/components/schemas/id'
81 type: string 79 replace:
82 example: composing 80 $ref: '#/components/schemas/replace'
81 from:
82 $ref: '#/components/schemas/from'
83 body:
84 $ref: '#/components/schemas/body'
85 kind:
86 $ref: '#/components/schemas/kind'
87 show:
88 $ref: '#/components/schemas/show'
89 stats:
90 $ref: '#/components/schemas/stats'
91 priority:
92 $ref: '#/components/schemas/priority'
93 nick:
94 $ref: '#/components/schemas/nick'
95 to:
96 $ref: '#/components/schemas/to'
97 ping:
98 $ref: '#/components/schemas/ping'
99 subject:
100 $ref: '#/components/schemas/subject'
101 lang:
102 $ref: '#/components/schemas/lang'
103 join:
104 $ref: '#/components/schemas/join'
105 html:
106 $ref: '#/components/schemas/html'
107 dataform:
108 $ref: '#/components/schemas/dataform'
109 version:
110 $ref: '#/components/schemas/version'
111 payload:
112 $ref: '#/components/schemas/payload'
113 disco:
114 $ref: '#/components/schemas/disco'
115 oob_url:
116 $ref: '#/components/schemas/oob_url'
117 items:
118 $ref: '#/components/schemas/items'
119 formdata:
120 $ref: '#/components/schemas/formdata'
83 thread: 121 thread:
84 type: string 122 $ref: '#/components/schemas/thread'
85 description: Message thread identifier
86 status:
87 type: string
88 description: Textual status message.
89 id:
90 type: string
91 description: Reasonably unique id. mod_rest generates one if left out.
92 replace:
93 type: string
94 description: ID of message being replaced (e.g. for corrections)
95 from:
96 description: the sender
97 type: string
98 example: bob@localhost.example
99 body:
100 description: Human-readable chat message
101 type: string
102 example: Hello, World!
103 command: 123 command:
104 oneOf: 124 $ref: '#/components/schemas/command'
105 - type: string
106 - type: object
107 properties:
108 data:
109 $ref: '#/components/schemas/stanza/properties/formdata'
110 action:
111 type: string
112 note:
113 type: object
114 properties:
115 text:
116 type: string
117 type:
118 type: string
119 enum:
120 - info
121 - warn
122 - error
123 form:
124 $ref: '#/components/schemas/stanza/properties/dataform'
125 sessionid:
126 type: string
127 status:
128 type: string
129 node:
130 type: string
131 actions:
132 type: object
133 properties:
134 complete:
135 type: boolean
136 prev:
137 type: boolean
138 next:
139 type: boolean
140 execute:
141 type: string
142 description: Ad-hoc commands.
143 show:
144 description: indicator of availability, ie away or not
145 type: string
146 enum:
147 - away
148 - chat
149 - dnd
150 - xa
151 stats:
152 description: Statistics
153 type: array
154 items:
155 type: object
156 properties:
157 name:
158 type: string
159 unit:
160 type: string
161 value:
162 type: string
163 priority:
164 type: string
165 description: presence priority
166 kind:
167 description: Which kind of stanza
168 type: string
169 enum:
170 - message
171 - presence
172 - iq
173 to:
174 description: recipient
175 type: string
176 example: alice@example.com
177 type:
178 description: Stanza type
179 type: string
180 enum:
181 - chat
182 - normal
183 - headline
184 - groupchat
185 - get
186 - set
187 - result
188 - available
189 - unavailable
190 - subscribe
191 - subscribed
192 - unsubscribe
193 - unsubscribed
194 lang:
195 description: Language code
196 type: string
197 example: en
198 formdata:
199 additionalProperties:
200 oneOf:
201 - type: string
202 - type: array
203 items:
204 type: string
205 type: object
206 description: Simplified data form
207 join:
208 description: For joining Multi-User-Chats
209 type: boolean
210 enum:
211 - true
212 dataform:
213 properties:
214 title:
215 type: string
216 fields:
217 type: array
218 items:
219 type: object
220 properties:
221 value:
222 oneOf:
223 - type: string
224 - type: array
225 items:
226 type: string
227 type:
228 type: string
229 label:
230 type: string
231 desc:
232 type: string
233 required:
234 type: boolean
235 var:
236 type: string
237 type:
238 type: string
239 enum:
240 - form
241 - submit
242 - cancel
243 - result
244 instructions:
245 type: string
246 description: Data form
247 type: object
248 items:
249 oneOf:
250 - description: An items query or empty list
251 type: boolean
252 enum:
253 - true
254 - type: string
255 description: A query with a node, or an empty reply list with a node
256 - description: List of items referenced
257 type: array
258 items:
259 properties:
260 jid:
261 type: string
262 description: Address of item
263 node:
264 type: string
265 name:
266 type: string
267 description: Descriptive name
268 required:
269 - jid
270 type: object
271 description: List of references to other entities
272 version:
273 oneOf:
274 - type: boolean
275 - properties:
276 version:
277 type: string
278 name:
279 type: string
280 os:
281 type: string
282 required:
283 - name
284 - version
285 type: object
286 description: Software version query
287 payload:
288 required:
289 - datatype
290 - data
291 properties:
292 data:
293 type: object
294 datatype:
295 type: string
296 description: A piece of arbitrary JSON with a type field attached
297 type: object
298 disco:
299 oneOf:
300 - type: boolean
301 description: Either a query, or an empty response
302 - type: string
303 description: A query with a node, or an empty response with a node
304 - properties:
305 features:
306 description: List of URIs indicating supported features
307 type: array
308 items:
309 type: string
310 identities:
311 items:
312 type: object
313 properties:
314 name:
315 type: string
316 type:
317 type: string
318 category:
319 type: string
320 description: List of abstract identities or types that describe the
321 entity
322 type: array
323 example:
324 - name: Prosody
325 type: im
326 category: server
327 node:
328 type: string
329 extensions:
330 type: object
331 description: A full response
332 type: object
333 description: Discover supported features
334 oob_url:
335 type: string
336 description: URL of an attached media file.
337 html:
338 description: HTML version of 'body'
339 type: string
340 example: <body><p>Hello!</p></body>
341 subject:
342 description: Subject of message or group chat
343 type: string
344 example: Talking about stuff
345 ping:
346 description: A ping.
347 type: boolean
348 enum:
349 - true
350 nick:
351 type: string
352 description: Nickname of the sender
353 type: object 125 type: object
354 example: 126 example:
355 body: Hello 127 body: Hello
356 type: chat 128 type: chat
357 kind: message 129 kind: message
130 to: alice@example.com
358 state: active 131 state: active
359 to: alice@example.com 132 delay:
133 type: string
134 description: Timestamp of when a stanza was delayed, in ISO 8601 / XEP-0082
135 format.
136 state:
137 enum:
138 - active
139 - inactive
140 - gone
141 - composing
142 - paused
143 description: Chat state notifications, e.g. "is typing..."
144 type: string
145 example: composing
146 thread:
147 type: string
148 description: Message thread identifier
149 status:
150 type: string
151 description: Textual status message.
152 id:
153 type: string
154 description: Reasonably unique id. mod_rest generates one if left out.
155 replace:
156 type: string
157 description: ID of message being replaced (e.g. for corrections)
158 from:
159 description: the sender
160 type: string
161 example: bob@localhost.example
162 body:
163 description: Human-readable chat message
164 type: string
165 example: Hello, World!
166 command:
167 oneOf:
168 - type: string
169 - type: object
170 properties:
171 data:
172 $ref: '#/components/schemas/stanza/properties/formdata'
173 action:
174 type: string
175 note:
176 type: object
177 properties:
178 text:
179 type: string
180 type:
181 type: string
182 enum:
183 - info
184 - warn
185 - error
186 form:
187 $ref: '#/components/schemas/stanza/properties/dataform'
188 sessionid:
189 type: string
190 status:
191 type: string
192 node:
193 type: string
194 actions:
195 type: object
196 properties:
197 complete:
198 type: boolean
199 prev:
200 type: boolean
201 next:
202 type: boolean
203 execute:
204 type: string
205 description: Ad-hoc commands.
206 show:
207 description: indicator of availability, ie away or not
208 type: string
209 enum:
210 - away
211 - chat
212 - dnd
213 - xa
214 stats:
215 description: Statistics
216 type: array
217 items:
218 type: object
219 properties:
220 name:
221 type: string
222 unit:
223 type: string
224 value:
225 type: string
226 priority:
227 type: string
228 description: presence priority
229 kind:
230 description: Which kind of stanza
231 type: string
232 enum:
233 - message
234 - presence
235 - iq
236 to:
237 description: recipient
238 type: string
239 example: alice@example.com
240 type:
241 description: Stanza type
242 type: string
243 enum:
244 - chat
245 - normal
246 - headline
247 - groupchat
248 - get
249 - set
250 - result
251 - available
252 - unavailable
253 - subscribe
254 - subscribed
255 - unsubscribe
256 - unsubscribed
257 lang:
258 description: Language code
259 type: string
260 example: en
261 formdata:
262 additionalProperties:
263 oneOf:
264 - type: string
265 - type: array
266 items:
267 type: string
268 type: object
269 description: Simplified data form
270 join:
271 description: For joining Multi-User-Chats
272 type: boolean
273 enum:
274 - true
275 dataform:
276 properties:
277 title:
278 type: string
279 fields:
280 type: array
281 items:
282 type: object
283 properties:
284 value:
285 oneOf:
286 - type: string
287 - type: array
288 items:
289 type: string
290 type:
291 type: string
292 label:
293 type: string
294 desc:
295 type: string
296 required:
297 type: boolean
298 var:
299 type: string
300 type:
301 type: string
302 enum:
303 - form
304 - submit
305 - cancel
306 - result
307 instructions:
308 type: string
309 description: Data form
310 type: object
311 items:
312 oneOf:
313 - description: An items query or empty list
314 type: boolean
315 enum:
316 - true
317 - type: string
318 description: A query with a node, or an empty reply list with a node
319 - description: List of items referenced
320 type: array
321 items:
322 properties:
323 jid:
324 type: string
325 description: Address of item
326 node:
327 type: string
328 name:
329 type: string
330 description: Descriptive name
331 required:
332 - jid
333 type: object
334 description: List of references to other entities
335 version:
336 oneOf:
337 - type: boolean
338 - properties:
339 version:
340 type: string
341 name:
342 type: string
343 os:
344 type: string
345 required:
346 - name
347 - version
348 type: object
349 description: Software version query
350 payload:
351 required:
352 - datatype
353 - data
354 properties:
355 data:
356 type: object
357 datatype:
358 type: string
359 description: A piece of arbitrary JSON with a type field attached
360 type: object
361 disco:
362 oneOf:
363 - type: boolean
364 description: Either a query, or an empty response
365 - type: string
366 description: A query with a node, or an empty response with a node
367 - properties:
368 features:
369 description: List of URIs indicating supported features
370 type: array
371 items:
372 type: string
373 identities:
374 items:
375 type: object
376 properties:
377 name:
378 type: string
379 type:
380 type: string
381 category:
382 type: string
383 description: List of abstract identities or types that describe the
384 entity
385 type: array
386 example:
387 - name: Prosody
388 type: im
389 category: server
390 node:
391 type: string
392 extensions:
393 type: object
394 description: A full response
395 type: object
396 description: Discover supported features
397 oob_url:
398 type: string
399 description: URL of an attached media file.
400 html:
401 description: HTML version of 'body'
402 type: string
403 example: <body><p>Hello!</p></body>
404 subject:
405 description: Subject of message or group chat
406 type: string
407 example: Talking about stuff
408 ping:
409 description: A ping.
410 type: boolean
411 enum:
412 - true
413 nick:
414 type: string
415 description: Nickname of the sender
360 securitySchemes: 416 securitySchemes:
361 token: 417 token:
362 description: Tokens from mod_http_oauth2. 418 description: Tokens from mod_http_oauth2.
363 scheme: Bearer 419 scheme: Bearer
364 type: http 420 type: http