comparison mod_rest/openapi.yaml @ 4487:f877a4d3770b

mod_rest/openapi: Deduplicate things using references
author Kim Alvefur <zash@zash.se>
date Tue, 02 Mar 2021 18:35:54 +0100
parents 4f41678ba00d
children 9d576af18611
comparison
equal deleted inserted replaced
4486:4f41678ba00d 4487:f877a4d3770b
11 name: MIT 11 name: MIT
12 paths: 12 paths:
13 /rest: 13 /rest:
14 post: 14 post:
15 requestBody: 15 requestBody:
16 required: true 16 $ref: '#/components/requestBodies/common'
17 content:
18 application/x-www-form-urlencoded:
19 schema:
20 description: A subset of the JSON schema, only top level string fields.
21 application/xmpp+xml:
22 schema:
23 description: Single XMPP stanza in XML format.
24 application/json:
25 schema:
26 $ref: '#/components/schemas/stanza'
27 security: 17 security:
28 - basic: [] 18 - basic: []
29 - token: [] 19 - token: []
30 summary: Send stanzas and receive responses. Webhooks work the same way. 20 summary: Send stanzas and receive responses. Webhooks work the same way.
31 responses: 21 responses:
32 200: 22 200:
33 content: 23 $ref: '#/components/responses/success'
34 text/plain:
35 schema:
36 description: Plain text response used as message body.
37 example: Hello
38 type: string
39 application/x-www-form-urlencoded:
40 schema:
41 description: A subset of the JSON schema, only top level string fields.
42 example: body=Hello
43 application/xmpp+xml:
44 schema:
45 description: Single XMPP stanza in XML format.
46 example: <message><body>Hello</body></message>
47 application/json:
48 schema:
49 $ref: '#/components/schemas/stanza'
50 description: The stanza was sent and returned a response.
51 401:
52 description: No credentials or auth token were provided.
53 202: 24 202:
54 description: The stanza was sent without problem, and without response, 25 $ref: '#/components/responses/sent'
55 so an empty reply. 26 /rest/{kind}/{type}/{to}:
56 403: 27 post:
57 description: Provided credentials or token not accepted. 28 security:
58 400: 29 - basic: []
59 description: There was a syntax problem in the payload. 30 - token: []
60 422: 31 summary: Even more RESTful mapping with certain components in the path.
61 description: The was a problem with the format (but not the syntax) of the 32 parameters:
62 payload. 33 - $ref: '#/components/parameters/kind'
63 415: 34 - $ref: '#/components/parameters/type'
64 description: Unsupported mediatype. 35 - $ref: '#/components/parameters/to'
36 responses:
37 200:
38 $ref: '#/components/responses/success'
65 /rest/ping/{to}: 39 /rest/ping/{to}:
66 get: 40 get:
67 security: 41 security:
68 - basic: [] 42 - basic: []
69 - token: [] 43 - token: []
70 summary: Ping a local or remote server or other entity 44 summary: Ping a local or remote server or other entity
71 responses: 45 responses:
72 200: 46 200:
73 content: 47 $ref: '#/components/responses/success'
74 application/json: 48 202:
75 schema: 49 $ref: '#/components/responses/sent'
76 type: object
77 application/xmpp+xml:
78 schema:
79 description: Single XMPP stanza in XML format.
80 example: |
81 <iq type="result"/>
82 description: OK
83 parameters: 50 parameters:
84 - name: to 51 - $ref: '#/components/parameters/to'
85 in: path
86 required: true
87 schema:
88 $ref: '#/components/schemas/to'
89 /rest/disco/{to}: 52 /rest/disco/{to}:
90 get: 53 get:
91 security: 54 security:
92 - basic: [] 55 - basic: []
93 - token: [] 56 - token: []
94 summary: Query a remote entity for supported features 57 summary: Query a remote entity for supported features
95 responses: 58 responses:
96 200: 59 200:
97 content: 60 $ref: '#/components/responses/success'
98 application/json:
99 schema:
100 type: object
101 properties:
102 disco:
103 $ref: '#/components/schemas/disco'
104 application/xmpp+xml:
105 schema:
106 description: See XEP-0030
107 description: OK
108 parameters: 61 parameters:
109 - name: to 62 - $ref: '#/components/parameters/to'
110 in: path
111 required: true
112 schema:
113 $ref: '#/components/schemas/to'
114 /rest/items/{to}: 63 /rest/items/{to}:
115 get: 64 get:
116 security: 65 security:
117 - basic: [] 66 - basic: []
118 - token: [] 67 - token: []
119 summary: Query an entity for related services, chat rooms or other items 68 summary: Query an entity for related services, chat rooms or other items
120 responses: 69 responses:
121 200: 70 200:
122 content: 71 $ref: '#/components/responses/success'
123 application/json:
124 schema:
125 type: object
126 properties:
127 disco:
128 $ref: '#/components/schemas/items'
129 application/xmpp+xml:
130 schema:
131 description: See XEP-0030
132 description: OK
133 parameters: 72 parameters:
134 - name: to 73 - $ref: '#/components/parameters/to'
135 in: path
136 required: true
137 schema:
138 $ref: '#/components/schemas/to'
139 /rest/version/{to}: 74 /rest/version/{to}:
140 get: 75 get:
141 security: 76 security:
142 - basic: [] 77 - basic: []
143 - token: [] 78 - token: []
144 summary: Ask what software version is used 79 summary: Ask what software version is used.
145 responses: 80 responses:
146 200: 81 200:
147 content: 82 $ref: '#/components/responses/success'
148 application/json:
149 schema:
150 $ref: '#/components/schemas/stanza'
151 application/xmpp+xml:
152 schema:
153 description: Single XMPP stanza in XML format.
154 example: |
155 <iq type="result">
156 <query xmlns="jabber:iq:version">
157 <name>Exodus</name>
158 <version>0.7.0.4</version>
159 </query>
160 </iq>
161 description: OK
162 parameters: 83 parameters:
163 - name: to 84 - $ref: '#/components/parameters/to'
164 in: path
165 required: true
166 schema:
167 $ref: '#/components/schemas/to'
168 /rest/{kind}/{type}/{to}:
169 post:
170 responses:
171 200:
172 description: Okay
173 security:
174 - basic: []
175 - token: []
176 summary: Even more RESTful mapping.
177 parameters:
178 - name: kind
179 in: path
180 required: true
181 schema:
182 $ref: '#/components/schemas/kind'
183 - name: type
184 in: path
185 required: true
186 schema:
187 $ref: '#/components/schemas/type'
188 - name: to
189 in: path
190 required: true
191 schema:
192 $ref: '#/components/schemas/to'
193 components: 85 components:
194 schemas: 86 schemas:
195 stanza: 87 stanza:
196 properties: 88 properties:
197 delay: 89 delay:
573 type: http 465 type: http
574 basic: 466 basic:
575 description: Use JID as username. 467 description: Use JID as username.
576 scheme: Basic 468 scheme: Basic
577 type: http 469 type: http
470 requestBodies:
471 common:
472 required: true
473 content:
474 application/x-www-form-urlencoded:
475 schema:
476 description: A subset of the JSON schema, only top level string fields.
477 application/xmpp+xml:
478 schema:
479 description: Single XMPP stanza in XML format.
480 application/json:
481 schema:
482 $ref: '#/components/schemas/stanza'
483 responses:
484 success:
485 description: The stanza was sent and returned a response.
486 content:
487 application/json:
488 schema:
489 $ref: '#/components/schemas/stanza'
490 application/xmpp+xml:
491 schema:
492 description: Single XMPP stanza in XML format.
493 example: <message><body>Hello</body></message>
494 application/x-www-form-urlencoded:
495 schema:
496 description: A subset of the JSON schema, only top level string fields.
497 example: body=Hello
498 text/plain:
499 schema:
500 description: Plain text response used as message body.
501 example: Hello
502 type: string
503 sent:
504 description: The stanza was sent without problem, and without response,
505 so an empty reply.
506 parameters:
507 to:
508 name: to
509 in: path
510 required: true
511 schema:
512 $ref: '#/components/schemas/to'
513 kind:
514 name: kind
515 in: path
516 required: true
517 schema:
518 $ref: '#/components/schemas/kind'
519 type:
520 name: type
521 in: path
522 required: true
523 schema:
524 $ref: '#/components/schemas/type'
525
578 ... 526 ...