Adapt tests for OpenApi
[netconf.git] / restconf / restconf-openapi / src / test / resources / toaster-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 is 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",
22           "content": {
23             "application/json": {
24               "schema": {
25                 "properties": {
26                   "toaster": {
27                     "$ref": "#/components/schemas/toaster_toaster",
28                     "type": "object"
29                   }
30                 }
31               }
32             },
33             "application/xml": {
34               "schema": {
35                 "$ref": "#/components/schemas/toaster_toaster"
36               }
37             }
38           }
39         },
40         "responses": {
41           "201": {
42             "description": "Created"
43           }
44         },
45         "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",
46         "summary": "POST - Controller - toaster - toaster"
47       }
48     },
49     "/rests/operations/toaster:cancel-toast": {
50       "post": {
51         "tags": [
52           "Controller toaster"
53         ],
54         "parameters": [],
55         "requestBody": {
56           "description": "cancel-toast_input",
57           "content": {
58             "application/json": {
59               "schema": {
60                 "properties": {
61                   "input": {
62                     "type": "object"
63                   }
64                 },
65                 "type": "object"
66               }
67             },
68             "application/xml": {
69               "schema": {
70                 "xml": {
71                   "name": "input",
72                   "namespace": "http://netconfcentral.org/ns/toaster"
73                 },
74                 "type": "object"
75               }
76             }
77           }
78         },
79         "responses": {
80           "204": {
81             "description": "RPC cancel-toast success"
82           }
83         },
84         "description": "Stop making toast, if any is being made.\nA 'resource-denied' error will be returned\nif the toaster service is disabled.",
85         "summary": "POST - Controller - toaster - cancel-toast"
86       }
87     },
88     "/rests/data/toaster:toaster": {
89       "get": {
90         "tags": [
91           "Controller toaster"
92         ],
93         "parameters": [
94           {
95             "name": "content",
96             "in": "query",
97             "required": false,
98             "schema": {
99               "enum": [
100                 "config",
101                 "nonconfig",
102                 "all"
103               ],
104               "type": "string"
105             }
106           }
107         ],
108         "responses": {
109           "200": {
110             "description": "200",
111             "content": {
112               "application/json": {
113                 "schema": {
114                   "properties": {
115                     "toaster": {
116                       "$ref": "#/components/schemas/toaster_toaster",
117                       "type": "object"
118                     }
119                   }
120                 }
121               },
122               "application/xml": {
123                 "schema": {
124                   "$ref": "#/components/schemas/toaster_toaster"
125                 }
126               }
127             }
128           }
129         },
130         "description": "Top-level container for all toaster database objects.",
131         "summary": "GET - Controller - toaster - toaster"
132       },
133       "put": {
134         "tags": [
135           "Controller toaster"
136         ],
137         "parameters": [],
138         "requestBody": {
139           "description": "toaster",
140           "content": {
141             "application/json": {
142               "schema": {
143                 "properties": {
144                   "toaster:toaster": {
145                     "$ref": "#/components/schemas/toaster_toaster",
146                     "type": "object"
147                   }
148                 }
149               }
150             },
151             "application/xml": {
152               "schema": {
153                 "$ref": "#/components/schemas/toaster_toaster"
154               }
155             }
156           }
157         },
158         "responses": {
159           "204": {
160             "description": "Updated"
161           },
162           "201": {
163             "description": "Created"
164           }
165         },
166         "description": "Top-level container for all toaster database objects.",
167         "summary": "PUT - toaster - Controller - toaster"
168       },
169       "delete": {
170         "tags": [
171           "Controller toaster"
172         ],
173         "parameters": [],
174         "responses": {
175           "204": {
176             "description": "Deleted"
177           }
178         },
179         "description": "Top-level container for all toaster database objects.",
180         "summary": "DELETE - Controller - toaster - toaster"
181       },
182       "patch": {
183         "tags": [
184           "Controller toaster"
185         ],
186         "parameters": [],
187         "requestBody": {
188           "description": "toaster",
189           "content": {
190             "application/yang-data+xml": {
191               "schema": {
192                 "$ref": "#/components/schemas/toaster_toaster"
193               }
194             },
195             "application/yang-data+json": {
196               "schema": {
197                 "properties": {
198                   "toaster:toaster": {
199                     "$ref": "#/components/schemas/toaster_toaster",
200                     "type": "object"
201                   }
202                 }
203               }
204             }
205           }
206         },
207         "responses": {
208           "200": {
209             "description": "OK"
210           },
211           "204": {
212             "description": "Updated"
213           }
214         },
215         "description": "Top-level container for all toaster database objects.",
216         "summary": "PATCH - toaster - Controller - toaster"
217       }
218     },
219     "/rests/operations/toaster:make-toast": {
220       "post": {
221         "tags": [
222           "Controller toaster"
223         ],
224         "parameters": [],
225         "requestBody": {
226           "description": "make-toast_input",
227           "content": {
228             "application/json": {
229               "schema": {
230                 "properties": {
231                   "input": {
232                     "$ref": "#/components/schemas/toaster_make-toast_input",
233                     "type": "object"
234                   }
235                 }
236               }
237             },
238             "application/xml": {
239               "schema": {
240                 "$ref": "#/components/schemas/toaster_make-toast_input"
241               }
242             }
243           }
244         },
245         "responses": {
246           "204": {
247             "description": "RPC make-toast success"
248           }
249         },
250         "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.",
251         "summary": "POST - Controller - toaster - make-toast"
252       }
253     },
254     "/rests/operations/toaster:restock-toaster": {
255       "post": {
256         "tags": [
257           "Controller toaster"
258         ],
259         "parameters": [],
260         "requestBody": {
261           "description": "restock-toaster_input",
262           "content": {
263             "application/json": {
264               "schema": {
265                 "properties": {
266                   "input": {
267                     "$ref": "#/components/schemas/toaster_restock-toaster_input",
268                     "type": "object"
269                   }
270                 }
271               }
272             },
273             "application/xml": {
274               "schema": {
275                 "$ref": "#/components/schemas/toaster_restock-toaster_input"
276               }
277             }
278           }
279         },
280         "responses": {
281           "204": {
282             "description": "RPC restock-toaster success"
283           }
284         },
285         "description": "Restocks the toaster with the amount of bread specified.",
286         "summary": "POST - Controller - toaster - restock-toaster"
287       }
288     }
289   },
290   "components": {
291     "schemas": {
292       "toaster_make-toast_input": {
293         "properties": {
294           "toasterDoneness": {
295             "default": 5,
296             "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.",
297             "type": "integer",
298             "example": 1,
299             "format": "int64"
300           },
301           "toasterToastType": {
302             "default": "wheat-bread",
303             "description": "This variable informs the toaster of the type of\nmaterial that is being toasted. The toaster\nuses this information, combined with\ntoasterDoneness, to compute for how\nlong the material must be toasted to achieve\nthe required doneness.",
304             "type": "string",
305             "example": "toast-type",
306             "enum": [
307               "toast-type",
308               "frozen-bagel",
309               "hash-brown",
310               "wonder-bread",
311               "frozen-waffle",
312               "white-bread",
313               "wheat-bread"
314             ]
315           }
316         },
317         "xml": {
318           "name": "input",
319           "namespace": "http://netconfcentral.org/ns/toaster"
320         },
321         "title": "toaster_make-toast_input",
322         "type": "object"
323       },
324       "toaster_restock-toaster_input": {
325         "properties": {
326           "amountOfBreadToStock": {
327             "description": "Indicates the amount of bread to re-stock",
328             "type": "integer",
329             "example": 0,
330             "format": "int64"
331           }
332         },
333         "xml": {
334           "name": "input",
335           "namespace": "http://netconfcentral.org/ns/toaster"
336         },
337         "title": "toaster_restock-toaster_input",
338         "type": "object"
339       },
340       "toaster_toaster": {
341         "properties": {
342           "darknessFactor": {
343             "default": 1000,
344             "description": "The darkness factor. Basically, the number of ms to multiple the doneness value by.",
345             "type": "integer",
346             "example": 0,
347             "format": "int64"
348           }
349         },
350         "xml": {
351           "name": "toaster",
352           "namespace": "http://netconfcentral.org/ns/toaster"
353         },
354         "description": "Top-level container for all toaster database objects.",
355         "title": "toaster_toaster",
356         "type": "object"
357       }
358     },
359     "securitySchemes": {
360       "basicAuth": {
361         "scheme": "basic",
362         "type": "http"
363       }
364     }
365   },
366   "security": [
367     {
368       "basicAuth": []
369     }
370   ]
371 }