Adapt tests for OpenApi
[netconf.git] / restconf / restconf-openapi / src / test / resources / yang-document / device-choice-test.json
1 {
2   "openapi": "3.0.3",
3   "info": {
4     "version": "1.0.0",
5     "title": "choice-test",
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/nodes/node=123/yang-ext:mount/choice-test:first-container": {
15       "get": {
16         "tags": [
17           "123 choice-test"
18         ],
19         "parameters": [
20           {
21             "name": "content",
22             "in": "query",
23             "required": false,
24             "schema": {
25               "enum": [
26                 "config",
27                 "nonconfig",
28                 "all"
29               ],
30               "type": "string"
31             }
32           }
33         ],
34         "responses": {
35           "200": {
36             "description": "200",
37             "content": {
38               "application/xml": {
39                 "schema": {
40                   "$ref": "#/components/schemas/choice-test_first-container"
41                 }
42               },
43               "application/json": {
44                 "schema": {
45                   "properties": {
46                     "first-container": {
47                       "$ref": "#/components/schemas/choice-test_first-container",
48                       "type": "object"
49                     }
50                   }
51                 }
52               }
53             }
54           }
55         },
56         "description": "",
57         "summary": "GET - 123 - choice-test - first-container"
58       },
59       "put": {
60         "tags": [
61           "123 choice-test"
62         ],
63         "parameters": [],
64         "requestBody": {
65           "description": "first-container",
66           "content": {
67             "application/xml": {
68               "schema": {
69                 "$ref": "#/components/schemas/choice-test_first-container"
70               }
71             },
72             "application/json": {
73               "schema": {
74                 "properties": {
75                   "choice-test:first-container": {
76                     "$ref": "#/components/schemas/choice-test_first-container",
77                     "type": "object"
78                   }
79                 }
80               }
81             }
82           }
83         },
84         "responses": {
85           "204": {
86             "description": "Updated"
87           },
88           "201": {
89             "description": "Created"
90           }
91         },
92         "description": "",
93         "summary": "PUT - choice-test - 123 - first-container"
94       },
95       "delete": {
96         "tags": [
97           "123 choice-test"
98         ],
99         "parameters": [],
100         "responses": {
101           "204": {
102             "description": "Deleted"
103           }
104         },
105         "description": "",
106         "summary": "DELETE - 123 - choice-test - first-container"
107       },
108       "patch": {
109         "tags": [
110           "123 choice-test"
111         ],
112         "parameters": [],
113         "requestBody": {
114           "description": "first-container",
115           "content": {
116             "application/yang-data+json": {
117               "schema": {
118                 "properties": {
119                   "choice-test:first-container": {
120                     "$ref": "#/components/schemas/choice-test_first-container",
121                     "type": "object"
122                   }
123                 }
124               }
125             },
126             "application/yang-data+xml": {
127               "schema": {
128                 "$ref": "#/components/schemas/choice-test_first-container"
129               }
130             }
131           }
132         },
133         "responses": {
134           "200": {
135             "description": "OK"
136           },
137           "204": {
138             "description": "Updated"
139           }
140         },
141         "description": "",
142         "summary": "PATCH - choice-test - 123 - first-container"
143       }
144     },
145     "/rests/data/nodes/node=123/yang-ext:mount/choice-test:second-container": {
146       "get": {
147         "tags": [
148           "123 choice-test"
149         ],
150         "parameters": [
151           {
152             "name": "content",
153             "in": "query",
154             "required": false,
155             "schema": {
156               "enum": [
157                 "config",
158                 "nonconfig",
159                 "all"
160               ],
161               "type": "string"
162             }
163           }
164         ],
165         "responses": {
166           "200": {
167             "description": "200",
168             "content": {
169               "application/xml": {
170                 "schema": {
171                   "$ref": "#/components/schemas/choice-test_second-container"
172                 }
173               },
174               "application/json": {
175                 "schema": {
176                   "properties": {
177                     "second-container": {
178                       "$ref": "#/components/schemas/choice-test_second-container",
179                       "type": "object"
180                     }
181                   }
182                 }
183               }
184             }
185           }
186         },
187         "description": "",
188         "summary": "GET - 123 - choice-test - second-container"
189       },
190       "put": {
191         "tags": [
192           "123 choice-test"
193         ],
194         "parameters": [],
195         "requestBody": {
196           "description": "second-container",
197           "content": {
198             "application/xml": {
199               "schema": {
200                 "$ref": "#/components/schemas/choice-test_second-container"
201               }
202             },
203             "application/json": {
204               "schema": {
205                 "properties": {
206                   "choice-test:second-container": {
207                     "$ref": "#/components/schemas/choice-test_second-container",
208                     "type": "object"
209                   }
210                 }
211               }
212             }
213           }
214         },
215         "responses": {
216           "204": {
217             "description": "Updated"
218           },
219           "201": {
220             "description": "Created"
221           }
222         },
223         "description": "",
224         "summary": "PUT - choice-test - 123 - second-container"
225       },
226       "delete": {
227         "tags": [
228           "123 choice-test"
229         ],
230         "parameters": [],
231         "responses": {
232           "204": {
233             "description": "Deleted"
234           }
235         },
236         "description": "",
237         "summary": "DELETE - 123 - choice-test - second-container"
238       },
239       "patch": {
240         "tags": [
241           "123 choice-test"
242         ],
243         "parameters": [],
244         "requestBody": {
245           "description": "second-container",
246           "content": {
247             "application/yang-data+json": {
248               "schema": {
249                 "properties": {
250                   "choice-test:second-container": {
251                     "$ref": "#/components/schemas/choice-test_second-container",
252                     "type": "object"
253                   }
254                 }
255               }
256             },
257             "application/yang-data+xml": {
258               "schema": {
259                 "$ref": "#/components/schemas/choice-test_second-container"
260               }
261             }
262           }
263         },
264         "responses": {
265           "200": {
266             "description": "OK"
267           },
268           "204": {
269             "description": "Updated"
270           }
271         },
272         "description": "",
273         "summary": "PATCH - choice-test - 123 - second-container"
274       }
275     },
276     "/rests/data/nodes/node=123/yang-ext:mount": {
277       "post": {
278         "tags": [
279           "123 choice-test"
280         ],
281         "parameters": [],
282         "requestBody": {
283           "description": "first-container",
284           "content": {
285             "application/xml": {
286               "schema": {
287                 "$ref": "#/components/schemas/choice-test_first-container"
288               }
289             },
290             "application/json": {
291               "schema": {
292                 "properties": {
293                   "first-container": {
294                     "$ref": "#/components/schemas/choice-test_first-container",
295                     "type": "object"
296                   }
297                 }
298               }
299             }
300           }
301         },
302         "responses": {
303           "201": {
304             "description": "Created"
305           }
306         },
307         "description": "\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",
308         "summary": "POST - 123 - choice-test - choice-test"
309       }
310     }
311   },
312   "components": {
313     "schemas": {
314       "choice-test_first-container": {
315         "properties": {
316           "leaf-default": {
317             "default": "default-value",
318             "description": "",
319             "type": "string",
320             "example": "Some leaf-default"
321           }
322         },
323         "xml": {
324           "name": "first-container",
325           "namespace": "urn:opendaylight:choice-test"
326         },
327         "description": "",
328         "title": "choice-test_first-container",
329         "type": "object"
330       },
331       "choice-test_second-container": {
332         "properties": {
333           "leaf-first-case": {
334             "description": "",
335             "type": "string",
336             "example": "Some leaf-first-case"
337           }
338         },
339         "xml": {
340           "name": "second-container",
341           "namespace": "urn:opendaylight:choice-test"
342         },
343         "description": "",
344         "title": "choice-test_second-container",
345         "type": "object"
346       }
347     },
348     "securitySchemes": {
349       "basicAuth": {
350         "scheme": "basic",
351         "type": "http"
352       }
353     }
354   },
355   "security": [
356     {
357       "basicAuth": []
358     }
359   ]
360 }