Re-implement logic for security and securitySchemes
[netconf.git] / restconf / restconf-openapi / src / test / resources / toaster-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’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/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.\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.",
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           "201": {
121             "description": "Created"
122           },
123           "204": {
124             "description": "Updated"
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           "204": {
170             "description": "Updated"
171           },
172           "200": {
173             "description": "OK"
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.\nA 'resource-denied' error will be returned\nif the toaster service is disabled.",
216         "summary": "POST - 123 - toaster - cancel-toast"
217       }
218     },
219     "/rests/operations/nodes/node=123/yang-ext:mount/toaster:restock-toaster": {
220       "post": {
221         "tags": [
222           "123 toaster"
223         ],
224         "parameters": [],
225         "requestBody": {
226           "description": "restock-toaster_input",
227           "content": {
228             "application/xml": {
229               "schema": {
230                 "$ref": "#/components/schemas/toaster_restock-toaster_input"
231               }
232             },
233             "application/json": {
234               "schema": {
235                 "properties": {
236                   "input": {
237                     "$ref": "#/components/schemas/toaster_restock-toaster_input",
238                     "type": "object"
239                   }
240                 }
241               }
242             }
243           }
244         },
245         "responses": {
246           "204": {
247             "description": "RPC restock-toaster success"
248           }
249         },
250         "description": "Restocks the toaster with the amount of bread specified.",
251         "summary": "POST - 123 - toaster - restock-toaster"
252       }
253     },
254     "/rests/data/nodes/node=123/yang-ext:mount": {
255       "post": {
256         "tags": [
257           "123 toaster"
258         ],
259         "parameters": [],
260         "requestBody": {
261           "description": "toaster",
262           "content": {
263             "application/xml": {
264               "schema": {
265                 "$ref": "#/components/schemas/toaster_toaster"
266               }
267             },
268             "application/json": {
269               "schema": {
270                 "properties": {
271                   "toaster": {
272                     "$ref": "#/components/schemas/toaster_toaster",
273                     "type": "object"
274                   }
275                 }
276               }
277             }
278           }
279         },
280         "responses": {
281           "201": {
282             "description": "Created"
283           }
284         },
285         "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",
286         "summary": "POST - 123 - toaster - toaster"
287       }
288     }
289   },
290   "components": {
291     "schemas": {
292       "toaster_make-toast_input": {
293         "properties": {
294           "toasterToastType": {
295             "default": "wheat-bread",
296             "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.",
297             "type": "string",
298             "example": "toast-type",
299             "enum": [
300               "toast-type",
301               "frozen-bagel",
302               "hash-brown",
303               "wonder-bread",
304               "frozen-waffle",
305               "white-bread",
306               "wheat-bread"
307             ]
308           },
309           "toasterDoneness": {
310             "default": 5,
311             "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.",
312             "type": "integer",
313             "example": 1,
314             "format": "int64"
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 }