Test JSON representations of responses in OpenApi
[netconf.git] / restconf / restconf-openapi / src / test / resources / openapi-document / controller-toaster.json
1 {
2   "openapi": "3.0.3",
3   "info": {
4     "version": "1.0.0",
5     "title": "toaster",
6     "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That’s because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
7   },
8   "servers": [
9     {
10       "url": "http://localhost:8181/"
11     }
12   ],
13   "paths": {
14     "/rests/data": {
15       "post": {
16         "tags": [
17           "Controller toaster"
18         ],
19         "parameters": [],
20         "requestBody": {
21           "description": "toaster_module",
22           "content": {
23             "application/json": {
24               "schema": {
25                 "$ref": "#/components/schemas/toaster_module"
26               }
27             },
28             "application/xml": {
29               "schema": {
30                 "$ref": "#/components/schemas/toaster_module"
31               }
32             }
33           }
34         },
35         "responses": {
36           "201": {
37             "description": "Created"
38           }
39         },
40         "description": "YANG version of the TOASTER-MIB.\n\nNote:\nIn example payload, you can see only the first data node child of the resource to be created, following the\nguidelines of RFC 8040, which allows us to create only one resource in POST request.\n",
41         "summary": "POST - Controller - toaster - toaster_module"
42       }
43     },
44     "/rests/operations/toaster:cancel-toast": {
45       "post": {
46         "tags": [
47           "Controller toaster"
48         ],
49         "parameters": [],
50         "requestBody": {
51           "description": "cancel-toast_input",
52           "content": {
53             "application/json": {
54               "schema": {
55                 "properties": {
56                   "input": {
57                     "type": "object"
58                   }
59                 },
60                 "type": "object"
61               }
62             },
63             "application/xml": {
64               "schema": {
65                 "xml": {
66                   "name": "input"
67                 },
68                 "type": "object"
69               }
70             }
71           }
72         },
73         "responses": {
74           "204": {
75             "description": "RPC cancel-toast success"
76           }
77         },
78         "description": "Stop making toast, if any is being made.\nA 'resource-denied' error will be returned\nif the toaster service is disabled.",
79         "summary": "POST - Controller - toaster - cancel-toast"
80       }
81     },
82     "/rests/data/toaster:toaster": {
83       "get": {
84         "tags": [
85           "Controller toaster"
86         ],
87         "parameters": [
88           {
89             "name": "content",
90             "in": "query",
91             "required": false,
92             "schema": {
93               "enum": [
94                 "config",
95                 "nonconfig",
96                 "all"
97               ],
98               "type": "string"
99             }
100           }
101         ],
102         "responses": {
103           "200": {
104             "description": "200",
105             "content": {
106               "application/json": {
107                 "schema": {
108                   "properties": {
109                     "toaster": {
110                       "$ref": "#/components/schemas/toaster_toaster",
111                       "type": "object"
112                     }
113                   }
114                 }
115               },
116               "application/xml": {
117                 "schema": {
118                   "$ref": "#/components/schemas/toaster_toaster"
119                 }
120               }
121             }
122           }
123         },
124         "description": "Top-level container for all toaster database objects.",
125         "summary": "GET - Controller - toaster - toaster"
126       },
127       "put": {
128         "tags": [
129           "Controller toaster"
130         ],
131         "parameters": [],
132         "requestBody": {
133           "description": "toaster",
134           "content": {
135             "application/json": {
136               "schema": {
137                 "properties": {
138                   "toaster:toaster": {
139                     "$ref": "#/components/schemas/toaster_toaster",
140                     "type": "object"
141                   }
142                 }
143               }
144             },
145             "application/xml": {
146               "schema": {
147                 "$ref": "#/components/schemas/toaster_toaster"
148               }
149             }
150           }
151         },
152         "responses": {
153           "204": {
154             "description": "Updated"
155           },
156           "201": {
157             "description": "Created"
158           }
159         },
160         "description": "Top-level container for all toaster database objects.",
161         "summary": "PUT - toaster - Controller - toaster"
162       },
163       "post": {
164         "tags": [
165           "Controller toaster"
166         ],
167         "parameters": [],
168         "requestBody": {
169           "description": "toaster",
170           "content": {
171             "application/json": {
172               "schema": {
173                 "$ref": "#/components/schemas/toaster_toaster"
174               }
175             },
176             "application/xml": {
177               "schema": {
178                 "$ref": "#/components/schemas/toaster_toaster"
179               }
180             }
181           }
182         },
183         "responses": {
184           "201": {
185             "description": "Created"
186           }
187         },
188         "description": "Top-level container for all toaster database objects.\n\nNote:\nIn example payload, you can see only the first data node child of the resource to be created, following the\nguidelines of RFC 8040, which allows us to create only one resource in POST request.\n",
189         "summary": "POST - Controller - toaster - toaster"
190       },
191       "delete": {
192         "tags": [
193           "Controller toaster"
194         ],
195         "parameters": [],
196         "responses": {
197           "204": {
198             "description": "Deleted"
199           }
200         },
201         "description": "Top-level container for all toaster database objects.",
202         "summary": "DELETE - Controller - toaster - toaster"
203       },
204       "patch": {
205         "tags": [
206           "Controller toaster"
207         ],
208         "parameters": [],
209         "requestBody": {
210           "description": "toaster",
211           "content": {
212             "application/yang-data+xml": {
213               "schema": {
214                 "$ref": "#/components/schemas/toaster_toaster"
215               }
216             },
217             "application/yang-data+json": {
218               "schema": {
219                 "properties": {
220                   "toaster:toaster": {
221                     "$ref": "#/components/schemas/toaster_toaster",
222                     "type": "object"
223                   }
224                 }
225               }
226             }
227           }
228         },
229         "responses": {
230           "200": {
231             "description": "OK"
232           },
233           "204": {
234             "description": "Updated"
235           }
236         },
237         "description": "Top-level container for all toaster database objects.",
238         "summary": "PATCH - toaster - Controller - toaster"
239       }
240     },
241     "/rests/operations/toaster:make-toast": {
242       "post": {
243         "tags": [
244           "Controller toaster"
245         ],
246         "parameters": [],
247         "requestBody": {
248           "description": "make-toast_input",
249           "content": {
250             "application/json": {
251               "schema": {
252                 "properties": {
253                   "input": {
254                     "$ref": "#/components/schemas/toaster_make-toast_input",
255                     "type": "object"
256                   }
257                 }
258               }
259             },
260             "application/xml": {
261               "schema": {
262                 "$ref": "#/components/schemas/toaster_make-toast_input"
263               }
264             }
265           }
266         },
267         "responses": {
268           "204": {
269             "description": "RPC make-toast success"
270           }
271         },
272         "description": "Make some toast.\nThe toastDone notification will be sent when\nthe toast is finished.\nAn 'in-use' error will be returned if toast\nis already being made.\nA 'resource-denied' error will be returned\nif the toaster service is disabled.",
273         "summary": "POST - Controller - toaster - make-toast"
274       }
275     },
276     "/rests/operations/toaster:restock-toaster": {
277       "post": {
278         "tags": [
279           "Controller toaster"
280         ],
281         "parameters": [],
282         "requestBody": {
283           "description": "restock-toaster_input",
284           "content": {
285             "application/json": {
286               "schema": {
287                 "properties": {
288                   "input": {
289                     "$ref": "#/components/schemas/toaster_restock-toaster_input",
290                     "type": "object"
291                   }
292                 }
293               }
294             },
295             "application/xml": {
296               "schema": {
297                 "$ref": "#/components/schemas/toaster_restock-toaster_input"
298               }
299             }
300           }
301         },
302         "responses": {
303           "204": {
304             "description": "RPC restock-toaster success"
305           }
306         },
307         "description": "Restocks the toaster with the amount of bread specified.",
308         "summary": "POST - Controller - toaster - restock-toaster"
309       }
310     }
311   },
312   "components": {
313     "schemas": {
314       "hash-brown": {
315         "enum": [
316           "hash-brown"
317         ],
318         "description": "Hash browned potatos.",
319         "title": "hash-brown",
320         "type": "string"
321       },
322       "toaster_make-toast_input": {
323         "properties": {
324           "toasterDoneness": {
325             "default": 5,
326             "description": "This variable controls how well-done is the\nensuing toast. It should be on a scale of 1 to 10.\nToast made at 10 generally is considered unfit\nfor human consumption; toast made at 1 is warmed\nlightly.",
327             "type": "integer",
328             "example": 1,
329             "format": "int64"
330           },
331           "toasterToastType": {
332             "$ref": "#/components/schemas/toast-type"
333           }
334         },
335         "xml": {
336           "name": "input"
337         },
338         "title": "toaster_make-toast_input",
339         "type": "object"
340       },
341       "toast-type": {
342         "enum": [
343           "toast-type",
344           "white-bread",
345           "wonder-bread",
346           "hash-brown",
347           "frozen-waffle",
348           "wheat-bread",
349           "frozen-bagel"
350         ],
351         "description": "Base for all bread types supported by the toaster.\nNew bread types not listed here nay be added in the\nfuture.",
352         "title": "toast-type",
353         "type": "string"
354       },
355       "toaster_module": {
356         "properties": {
357           "toaster": {
358             "$ref": "#/components/schemas/toaster_toaster"
359           }
360         },
361         "description": "YANG version of the TOASTER-MIB.",
362         "title": "toaster_module",
363         "type": "object"
364       },
365       "frozen-bagel": {
366         "enum": [
367           "frozen-bagel"
368         ],
369         "description": "Frozen bagel.",
370         "title": "frozen-bagel",
371         "type": "string"
372       },
373       "toaster_restock-toaster_input": {
374         "properties": {
375           "amountOfBreadToStock": {
376             "description": "Indicates the amount of bread to re-stock",
377             "type": "integer",
378             "example": 0,
379             "format": "int64"
380           }
381         },
382         "xml": {
383           "name": "input"
384         },
385         "title": "toaster_restock-toaster_input",
386         "type": "object"
387       },
388       "frozen-waffle": {
389         "enum": [
390           "frozen-waffle"
391         ],
392         "description": "Frozen waffle.",
393         "title": "frozen-waffle",
394         "type": "string"
395       },
396       "white-bread": {
397         "enum": [
398           "white-bread"
399         ],
400         "description": "White bread.",
401         "title": "white-bread",
402         "type": "string"
403       },
404       "wheat-bread": {
405         "enum": [
406           "wheat-bread"
407         ],
408         "description": "Wheat bread.",
409         "title": "wheat-bread",
410         "type": "string"
411       },
412       "wonder-bread": {
413         "enum": [
414           "wonder-bread"
415         ],
416         "description": "Wonder bread.",
417         "title": "wonder-bread",
418         "type": "string"
419       },
420       "toaster_toaster": {
421         "properties": {
422           "darknessFactor": {
423             "default": 1000,
424             "description": "The darkness factor. Basically, the number of ms to multiple the doneness value by.",
425             "type": "integer",
426             "example": 0,
427             "format": "int64"
428           }
429         },
430         "xml": {
431           "name": "toaster",
432           "namespace": "http://netconfcentral.org/ns/toaster"
433         },
434         "description": "Top-level container for all toaster database objects.",
435         "title": "toaster_toaster",
436         "type": "object"
437       }
438     },
439     "securitySchemes": {
440       "basicAuth": {
441         "scheme": "basic",
442         "type": "http"
443       }
444     }
445   },
446   "security": [
447     {
448       "basicAuth": []
449     }
450   ]
451 }