OpenAPI: netopeer2 wrong schemas for actions
[netconf.git] / restconf / restconf-openapi / src / test / resources / yang-document / controller-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'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/choice-test:second-container": {
15       "get": {
16         "tags": [
17           "Controller 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_second-container"
41                 }
42               },
43               "application/json": {
44                 "schema": {
45                   "properties": {
46                     "second-container": {
47                       "$ref": "#/components/schemas/choice-test_second-container",
48                       "type": "object"
49                     }
50                   }
51                 }
52               }
53             }
54           }
55         },
56         "description": "",
57         "summary": "GET - Controller - choice-test - second-container"
58       },
59       "put": {
60         "tags": [
61           "Controller choice-test"
62         ],
63         "parameters": [],
64         "requestBody": {
65           "description": "second-container",
66           "content": {
67             "application/xml": {
68               "schema": {
69                 "$ref": "#/components/schemas/choice-test_second-container"
70               }
71             },
72             "application/json": {
73               "schema": {
74                 "properties": {
75                   "choice-test:second-container": {
76                     "$ref": "#/components/schemas/choice-test_second-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 - Controller - second-container"
94       },
95       "delete": {
96         "tags": [
97           "Controller choice-test"
98         ],
99         "parameters": [],
100         "responses": {
101           "204": {
102             "description": "Deleted"
103           }
104         },
105         "description": "",
106         "summary": "DELETE - Controller - choice-test - second-container"
107       },
108       "patch": {
109         "tags": [
110           "Controller choice-test"
111         ],
112         "parameters": [],
113         "requestBody": {
114           "description": "second-container",
115           "content": {
116             "application/yang-data+json": {
117               "schema": {
118                 "properties": {
119                   "choice-test:second-container": {
120                     "$ref": "#/components/schemas/choice-test_second-container",
121                     "type": "object"
122                   }
123                 }
124               }
125             },
126             "application/yang-data+xml": {
127               "schema": {
128                 "$ref": "#/components/schemas/choice-test_second-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 - Controller - second-container"
143       }
144     },
145     "/rests/data": {
146       "post": {
147         "tags": [
148           "Controller choice-test"
149         ],
150         "parameters": [],
151         "requestBody": {
152           "description": "first-container",
153           "content": {
154             "application/xml": {
155               "schema": {
156                 "$ref": "#/components/schemas/choice-test_first-container"
157               }
158             },
159             "application/json": {
160               "schema": {
161                 "properties": {
162                   "first-container": {
163                     "$ref": "#/components/schemas/choice-test_first-container",
164                     "type": "object"
165                   }
166                 }
167               }
168             }
169           }
170         },
171         "responses": {
172           "201": {
173             "description": "Created"
174           }
175         },
176         "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",
177         "summary": "POST - Controller - choice-test - choice-test"
178       }
179     },
180     "/rests/data/choice-test:first-container": {
181       "get": {
182         "tags": [
183           "Controller choice-test"
184         ],
185         "parameters": [
186           {
187             "name": "content",
188             "in": "query",
189             "required": false,
190             "schema": {
191               "enum": [
192                 "config",
193                 "nonconfig",
194                 "all"
195               ],
196               "type": "string"
197             }
198           }
199         ],
200         "responses": {
201           "200": {
202             "description": "200",
203             "content": {
204               "application/xml": {
205                 "schema": {
206                   "$ref": "#/components/schemas/choice-test_first-container"
207                 }
208               },
209               "application/json": {
210                 "schema": {
211                   "properties": {
212                     "first-container": {
213                       "$ref": "#/components/schemas/choice-test_first-container",
214                       "type": "object"
215                     }
216                   }
217                 }
218               }
219             }
220           }
221         },
222         "description": "",
223         "summary": "GET - Controller - choice-test - first-container"
224       },
225       "put": {
226         "tags": [
227           "Controller choice-test"
228         ],
229         "parameters": [],
230         "requestBody": {
231           "description": "first-container",
232           "content": {
233             "application/xml": {
234               "schema": {
235                 "$ref": "#/components/schemas/choice-test_first-container"
236               }
237             },
238             "application/json": {
239               "schema": {
240                 "properties": {
241                   "choice-test:first-container": {
242                     "$ref": "#/components/schemas/choice-test_first-container",
243                     "type": "object"
244                   }
245                 }
246               }
247             }
248           }
249         },
250         "responses": {
251           "204": {
252             "description": "Updated"
253           },
254           "201": {
255             "description": "Created"
256           }
257         },
258         "description": "",
259         "summary": "PUT - choice-test - Controller - first-container"
260       },
261       "delete": {
262         "tags": [
263           "Controller choice-test"
264         ],
265         "parameters": [],
266         "responses": {
267           "204": {
268             "description": "Deleted"
269           }
270         },
271         "description": "",
272         "summary": "DELETE - Controller - choice-test - first-container"
273       },
274       "patch": {
275         "tags": [
276           "Controller choice-test"
277         ],
278         "parameters": [],
279         "requestBody": {
280           "description": "first-container",
281           "content": {
282             "application/yang-data+json": {
283               "schema": {
284                 "properties": {
285                   "choice-test:first-container": {
286                     "$ref": "#/components/schemas/choice-test_first-container",
287                     "type": "object"
288                   }
289                 }
290               }
291             },
292             "application/yang-data+xml": {
293               "schema": {
294                 "$ref": "#/components/schemas/choice-test_first-container"
295               }
296             }
297           }
298         },
299         "responses": {
300           "200": {
301             "description": "OK"
302           },
303           "204": {
304             "description": "Updated"
305           }
306         },
307         "description": "",
308         "summary": "PATCH - choice-test - Controller - first-container"
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         "title": "choice-test_first-container",
328         "type": "object"
329       },
330       "choice-test_second-container": {
331         "properties": {
332           "leaf-first-case": {
333             "description": "",
334             "type": "string",
335             "example": "Some leaf-first-case"
336           }
337         },
338         "xml": {
339           "name": "second-container",
340           "namespace": "urn:opendaylight:choice-test"
341         },
342         "title": "choice-test_second-container",
343         "type": "object"
344       }
345     },
346     "securitySchemes": {
347       "basicAuth": {
348         "scheme": "basic",
349         "type": "http"
350       }
351     }
352   },
353   "security": [
354     {
355       "basicAuth": []
356     }
357   ]
358 }