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