Adapt tests for OpenApi
[netconf.git] / restconf / restconf-openapi / src / test / resources / yang-document / device-recursive.json
1 {
2   "openapi": "3.0.3",
3   "info": {
4     "version": "1.0.0",
5     "title": "recursive",
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/recursive:container-root/root-list={name}/nested-list={name1}": {
15       "get": {
16         "tags": [
17           "123 recursive"
18         ],
19         "parameters": [
20           {
21             "name": "name",
22             "in": "path",
23             "required": true,
24             "schema": {
25               "type": "string"
26             }
27           },
28           {
29             "name": "name1",
30             "in": "path",
31             "required": true,
32             "schema": {
33               "type": "string"
34             }
35           },
36           {
37             "name": "content",
38             "in": "query",
39             "required": false,
40             "schema": {
41               "enum": [
42                 "config",
43                 "nonconfig",
44                 "all"
45               ],
46               "type": "string"
47             }
48           }
49         ],
50         "responses": {
51           "200": {
52             "description": "200",
53             "content": {
54               "application/xml": {
55                 "schema": {
56                   "$ref": "#/components/schemas/recursive_container-root_root-list_nested-list"
57                 }
58               },
59               "application/json": {
60                 "schema": {
61                   "properties": {
62                     "nested-list": {
63                       "type": "array",
64                       "items": {
65                         "$ref": "#/components/schemas/recursive_container-root_root-list_nested-list",
66                         "type": "object"
67                       }
68                     }
69                   }
70                 }
71               }
72             }
73           }
74         },
75         "description": "",
76         "summary": "GET - 123 - recursive - nested-list"
77       },
78       "put": {
79         "tags": [
80           "123 recursive"
81         ],
82         "parameters": [
83           {
84             "name": "name",
85             "in": "path",
86             "required": true,
87             "schema": {
88               "type": "string"
89             }
90           },
91           {
92             "name": "name1",
93             "in": "path",
94             "required": true,
95             "schema": {
96               "type": "string"
97             }
98           }
99         ],
100         "requestBody": {
101           "description": "nested-list",
102           "content": {
103             "application/xml": {
104               "schema": {
105                 "$ref": "#/components/schemas/recursive_container-root_root-list_nested-list"
106               }
107             },
108             "application/json": {
109               "schema": {
110                 "properties": {
111                   "recursive:nested-list": {
112                     "type": "array",
113                     "items": {
114                       "$ref": "#/components/schemas/recursive_container-root_root-list_nested-list",
115                       "type": "object"
116                     }
117                   }
118                 }
119               }
120             }
121           }
122         },
123         "responses": {
124           "204": {
125             "description": "Updated"
126           },
127           "201": {
128             "description": "Created"
129           }
130         },
131         "description": "",
132         "summary": "PUT - recursive - 123 - nested-list"
133       },
134       "delete": {
135         "tags": [
136           "123 recursive"
137         ],
138         "parameters": [
139           {
140             "name": "name",
141             "in": "path",
142             "required": true,
143             "schema": {
144               "type": "string"
145             }
146           },
147           {
148             "name": "name1",
149             "in": "path",
150             "required": true,
151             "schema": {
152               "type": "string"
153             }
154           }
155         ],
156         "responses": {
157           "204": {
158             "description": "Deleted"
159           }
160         },
161         "description": "",
162         "summary": "DELETE - 123 - recursive - nested-list"
163       },
164       "patch": {
165         "tags": [
166           "123 recursive"
167         ],
168         "parameters": [
169           {
170             "name": "name",
171             "in": "path",
172             "required": true,
173             "schema": {
174               "type": "string"
175             }
176           },
177           {
178             "name": "name1",
179             "in": "path",
180             "required": true,
181             "schema": {
182               "type": "string"
183             }
184           }
185         ],
186         "requestBody": {
187           "description": "nested-list",
188           "content": {
189             "application/yang-data+json": {
190               "schema": {
191                 "properties": {
192                   "recursive:nested-list": {
193                     "type": "array",
194                     "items": {
195                       "$ref": "#/components/schemas/recursive_container-root_root-list_nested-list",
196                       "type": "object"
197                     }
198                   }
199                 }
200               }
201             },
202             "application/yang-data+xml": {
203               "schema": {
204                 "$ref": "#/components/schemas/recursive_container-root_root-list_nested-list"
205               }
206             }
207           }
208         },
209         "responses": {
210           "200": {
211             "description": "OK"
212           },
213           "204": {
214             "description": "Updated"
215           }
216         },
217         "description": "",
218         "summary": "PATCH - recursive - 123 - nested-list"
219       }
220     },
221     "/rests/data/nodes/node=123/yang-ext:mount/recursive:container-root": {
222       "get": {
223         "tags": [
224           "123 recursive"
225         ],
226         "parameters": [
227           {
228             "name": "content",
229             "in": "query",
230             "required": false,
231             "schema": {
232               "enum": [
233                 "config",
234                 "nonconfig",
235                 "all"
236               ],
237               "type": "string"
238             }
239           }
240         ],
241         "responses": {
242           "200": {
243             "description": "200",
244             "content": {
245               "application/xml": {
246                 "schema": {
247                   "$ref": "#/components/schemas/recursive_container-root"
248                 }
249               },
250               "application/json": {
251                 "schema": {
252                   "properties": {
253                     "container-root": {
254                       "$ref": "#/components/schemas/recursive_container-root",
255                       "type": "object"
256                     }
257                   }
258                 }
259               }
260             }
261           }
262         },
263         "description": "",
264         "summary": "GET - 123 - recursive - container-root"
265       },
266       "put": {
267         "tags": [
268           "123 recursive"
269         ],
270         "parameters": [],
271         "requestBody": {
272           "description": "container-root",
273           "content": {
274             "application/xml": {
275               "schema": {
276                 "$ref": "#/components/schemas/recursive_container-root"
277               }
278             },
279             "application/json": {
280               "schema": {
281                 "properties": {
282                   "recursive:container-root": {
283                     "$ref": "#/components/schemas/recursive_container-root",
284                     "type": "object"
285                   }
286                 }
287               }
288             }
289           }
290         },
291         "responses": {
292           "204": {
293             "description": "Updated"
294           },
295           "201": {
296             "description": "Created"
297           }
298         },
299         "description": "",
300         "summary": "PUT - recursive - 123 - container-root"
301       },
302       "post": {
303         "tags": [
304           "123 recursive"
305         ],
306         "parameters": [],
307         "requestBody": {
308           "description": "root-list",
309           "content": {
310             "application/xml": {
311               "schema": {
312                 "$ref": "#/components/schemas/recursive_container-root_root-list"
313               }
314             },
315             "application/json": {
316               "schema": {
317                 "properties": {
318                   "root-list": {
319                     "type": "array",
320                     "items": {
321                       "$ref": "#/components/schemas/recursive_container-root_root-list",
322                       "type": "object"
323                     }
324                   }
325                 }
326               }
327             }
328           }
329         },
330         "responses": {
331           "201": {
332             "description": "Created"
333           }
334         },
335         "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",
336         "summary": "POST - 123 - recursive - container-root"
337       },
338       "delete": {
339         "tags": [
340           "123 recursive"
341         ],
342         "parameters": [],
343         "responses": {
344           "204": {
345             "description": "Deleted"
346           }
347         },
348         "description": "",
349         "summary": "DELETE - 123 - recursive - container-root"
350       },
351       "patch": {
352         "tags": [
353           "123 recursive"
354         ],
355         "parameters": [],
356         "requestBody": {
357           "description": "container-root",
358           "content": {
359             "application/yang-data+json": {
360               "schema": {
361                 "properties": {
362                   "recursive:container-root": {
363                     "$ref": "#/components/schemas/recursive_container-root",
364                     "type": "object"
365                   }
366                 }
367               }
368             },
369             "application/yang-data+xml": {
370               "schema": {
371                 "$ref": "#/components/schemas/recursive_container-root"
372               }
373             }
374           }
375         },
376         "responses": {
377           "200": {
378             "description": "OK"
379           },
380           "204": {
381             "description": "Updated"
382           }
383         },
384         "description": "",
385         "summary": "PATCH - recursive - 123 - container-root"
386       }
387     },
388     "/rests/data/nodes/node=123/yang-ext:mount/recursive:container-root/root-list={name}": {
389       "get": {
390         "tags": [
391           "123 recursive"
392         ],
393         "parameters": [
394           {
395             "name": "name",
396             "in": "path",
397             "required": true,
398             "schema": {
399               "type": "string"
400             }
401           },
402           {
403             "name": "content",
404             "in": "query",
405             "required": false,
406             "schema": {
407               "enum": [
408                 "config",
409                 "nonconfig",
410                 "all"
411               ],
412               "type": "string"
413             }
414           }
415         ],
416         "responses": {
417           "200": {
418             "description": "200",
419             "content": {
420               "application/xml": {
421                 "schema": {
422                   "$ref": "#/components/schemas/recursive_container-root_root-list"
423                 }
424               },
425               "application/json": {
426                 "schema": {
427                   "properties": {
428                     "root-list": {
429                       "type": "array",
430                       "items": {
431                         "$ref": "#/components/schemas/recursive_container-root_root-list",
432                         "type": "object"
433                       }
434                     }
435                   }
436                 }
437               }
438             }
439           }
440         },
441         "description": "",
442         "summary": "GET - 123 - recursive - root-list"
443       },
444       "put": {
445         "tags": [
446           "123 recursive"
447         ],
448         "parameters": [
449           {
450             "name": "name",
451             "in": "path",
452             "required": true,
453             "schema": {
454               "type": "string"
455             }
456           }
457         ],
458         "requestBody": {
459           "description": "root-list",
460           "content": {
461             "application/xml": {
462               "schema": {
463                 "$ref": "#/components/schemas/recursive_container-root_root-list"
464               }
465             },
466             "application/json": {
467               "schema": {
468                 "properties": {
469                   "recursive:root-list": {
470                     "type": "array",
471                     "items": {
472                       "$ref": "#/components/schemas/recursive_container-root_root-list",
473                       "type": "object"
474                     }
475                   }
476                 }
477               }
478             }
479           }
480         },
481         "responses": {
482           "204": {
483             "description": "Updated"
484           },
485           "201": {
486             "description": "Created"
487           }
488         },
489         "description": "",
490         "summary": "PUT - recursive - 123 - root-list"
491       },
492       "delete": {
493         "tags": [
494           "123 recursive"
495         ],
496         "parameters": [
497           {
498             "name": "name",
499             "in": "path",
500             "required": true,
501             "schema": {
502               "type": "string"
503             }
504           }
505         ],
506         "responses": {
507           "204": {
508             "description": "Deleted"
509           }
510         },
511         "description": "",
512         "summary": "DELETE - 123 - recursive - root-list"
513       },
514       "patch": {
515         "tags": [
516           "123 recursive"
517         ],
518         "parameters": [
519           {
520             "name": "name",
521             "in": "path",
522             "required": true,
523             "schema": {
524               "type": "string"
525             }
526           }
527         ],
528         "requestBody": {
529           "description": "root-list",
530           "content": {
531             "application/yang-data+json": {
532               "schema": {
533                 "properties": {
534                   "recursive:root-list": {
535                     "type": "array",
536                     "items": {
537                       "$ref": "#/components/schemas/recursive_container-root_root-list",
538                       "type": "object"
539                     }
540                   }
541                 }
542               }
543             },
544             "application/yang-data+xml": {
545               "schema": {
546                 "$ref": "#/components/schemas/recursive_container-root_root-list"
547               }
548             }
549           }
550         },
551         "responses": {
552           "200": {
553             "description": "OK"
554           },
555           "204": {
556             "description": "Updated"
557           }
558         },
559         "description": "",
560         "summary": "PATCH - recursive - 123 - root-list"
561       }
562     },
563     "/rests/data/nodes/node=123/yang-ext:mount/recursive:container-root/root-list={name}/nested-list={name1}/super-nested-list={name2}": {
564       "get": {
565         "tags": [
566           "123 recursive"
567         ],
568         "parameters": [
569           {
570             "name": "name",
571             "in": "path",
572             "required": true,
573             "schema": {
574               "type": "string"
575             }
576           },
577           {
578             "name": "name1",
579             "in": "path",
580             "required": true,
581             "schema": {
582               "type": "string"
583             }
584           },
585           {
586             "name": "name2",
587             "in": "path",
588             "required": true,
589             "schema": {
590               "type": "string"
591             }
592           },
593           {
594             "name": "content",
595             "in": "query",
596             "required": false,
597             "schema": {
598               "enum": [
599                 "config",
600                 "nonconfig",
601                 "all"
602               ],
603               "type": "string"
604             }
605           }
606         ],
607         "responses": {
608           "200": {
609             "description": "200",
610             "content": {
611               "application/xml": {
612                 "schema": {
613                   "$ref": "#/components/schemas/recursive_container-root_root-list_nested-list_super-nested-list"
614                 }
615               },
616               "application/json": {
617                 "schema": {
618                   "properties": {
619                     "super-nested-list": {
620                       "type": "array",
621                       "items": {
622                         "$ref": "#/components/schemas/recursive_container-root_root-list_nested-list_super-nested-list",
623                         "type": "object"
624                       }
625                     }
626                   }
627                 }
628               }
629             }
630           }
631         },
632         "description": "",
633         "summary": "GET - 123 - recursive - super-nested-list"
634       },
635       "put": {
636         "tags": [
637           "123 recursive"
638         ],
639         "parameters": [
640           {
641             "name": "name",
642             "in": "path",
643             "required": true,
644             "schema": {
645               "type": "string"
646             }
647           },
648           {
649             "name": "name1",
650             "in": "path",
651             "required": true,
652             "schema": {
653               "type": "string"
654             }
655           },
656           {
657             "name": "name2",
658             "in": "path",
659             "required": true,
660             "schema": {
661               "type": "string"
662             }
663           }
664         ],
665         "requestBody": {
666           "description": "super-nested-list",
667           "content": {
668             "application/xml": {
669               "schema": {
670                 "$ref": "#/components/schemas/recursive_container-root_root-list_nested-list_super-nested-list"
671               }
672             },
673             "application/json": {
674               "schema": {
675                 "properties": {
676                   "recursive:super-nested-list": {
677                     "type": "array",
678                     "items": {
679                       "$ref": "#/components/schemas/recursive_container-root_root-list_nested-list_super-nested-list",
680                       "type": "object"
681                     }
682                   }
683                 }
684               }
685             }
686           }
687         },
688         "responses": {
689           "204": {
690             "description": "Updated"
691           },
692           "201": {
693             "description": "Created"
694           }
695         },
696         "description": "",
697         "summary": "PUT - recursive - 123 - super-nested-list"
698       },
699       "delete": {
700         "tags": [
701           "123 recursive"
702         ],
703         "parameters": [
704           {
705             "name": "name",
706             "in": "path",
707             "required": true,
708             "schema": {
709               "type": "string"
710             }
711           },
712           {
713             "name": "name1",
714             "in": "path",
715             "required": true,
716             "schema": {
717               "type": "string"
718             }
719           },
720           {
721             "name": "name2",
722             "in": "path",
723             "required": true,
724             "schema": {
725               "type": "string"
726             }
727           }
728         ],
729         "responses": {
730           "204": {
731             "description": "Deleted"
732           }
733         },
734         "description": "",
735         "summary": "DELETE - 123 - recursive - super-nested-list"
736       },
737       "patch": {
738         "tags": [
739           "123 recursive"
740         ],
741         "parameters": [
742           {
743             "name": "name",
744             "in": "path",
745             "required": true,
746             "schema": {
747               "type": "string"
748             }
749           },
750           {
751             "name": "name1",
752             "in": "path",
753             "required": true,
754             "schema": {
755               "type": "string"
756             }
757           },
758           {
759             "name": "name2",
760             "in": "path",
761             "required": true,
762             "schema": {
763               "type": "string"
764             }
765           }
766         ],
767         "requestBody": {
768           "description": "super-nested-list",
769           "content": {
770             "application/yang-data+json": {
771               "schema": {
772                 "properties": {
773                   "recursive:super-nested-list": {
774                     "type": "array",
775                     "items": {
776                       "$ref": "#/components/schemas/recursive_container-root_root-list_nested-list_super-nested-list",
777                       "type": "object"
778                     }
779                   }
780                 }
781               }
782             },
783             "application/yang-data+xml": {
784               "schema": {
785                 "$ref": "#/components/schemas/recursive_container-root_root-list_nested-list_super-nested-list"
786               }
787             }
788           }
789         },
790         "responses": {
791           "200": {
792             "description": "OK"
793           },
794           "204": {
795             "description": "Updated"
796           }
797         },
798         "description": "",
799         "summary": "PATCH - recursive - 123 - super-nested-list"
800       }
801     },
802     "/rests/data/nodes/node=123/yang-ext:mount": {
803       "post": {
804         "tags": [
805           "123 recursive"
806         ],
807         "parameters": [],
808         "requestBody": {
809           "description": "container-root",
810           "content": {
811             "application/xml": {
812               "schema": {
813                 "$ref": "#/components/schemas/recursive_container-root"
814               }
815             },
816             "application/json": {
817               "schema": {
818                 "properties": {
819                   "container-root": {
820                     "$ref": "#/components/schemas/recursive_container-root",
821                     "type": "object"
822                   }
823                 }
824               }
825             }
826           }
827         },
828         "responses": {
829           "201": {
830             "description": "Created"
831           }
832         },
833         "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",
834         "summary": "POST - 123 - recursive - recursive"
835       }
836     }
837   },
838   "components": {
839     "schemas": {
840       "recursive_container-root_root-list": {
841         "properties": {
842           "nested-list": {
843             "description": "",
844             "type": "array",
845             "items": {
846               "$ref": "#/components/schemas/recursive_container-root_root-list_nested-list"
847             }
848           },
849           "name": {
850             "description": "",
851             "type": "string",
852             "example": "Some name"
853           }
854         },
855         "xml": {
856           "name": "root-list",
857           "namespace": "urn:opendaylight:test:recursive"
858         },
859         "description": "",
860         "title": "recursive_container-root_root-list",
861         "type": "object"
862       },
863       "recursive_container-root_root-list_nested-list": {
864         "properties": {
865           "super-nested-list": {
866             "description": "",
867             "type": "array",
868             "items": {
869               "$ref": "#/components/schemas/recursive_container-root_root-list_nested-list_super-nested-list"
870             }
871           },
872           "name": {
873             "description": "",
874             "type": "string",
875             "example": "Some name"
876           }
877         },
878         "xml": {
879           "name": "nested-list",
880           "namespace": "urn:opendaylight:test:recursive"
881         },
882         "description": "",
883         "title": "recursive_container-root_root-list_nested-list",
884         "type": "object"
885       },
886       "recursive_container-root_root-list_nested-list_super-nested-list": {
887         "properties": {
888           "name": {
889             "description": "",
890             "type": "string",
891             "example": "Some name"
892           }
893         },
894         "xml": {
895           "name": "super-nested-list",
896           "namespace": "urn:opendaylight:test:recursive"
897         },
898         "description": "",
899         "title": "recursive_container-root_root-list_nested-list_super-nested-list",
900         "type": "object"
901       },
902       "recursive_container-root": {
903         "properties": {
904           "root-list": {
905             "description": "",
906             "type": "array",
907             "items": {
908               "$ref": "#/components/schemas/recursive_container-root_root-list"
909             }
910           }
911         },
912         "xml": {
913           "name": "container-root",
914           "namespace": "urn:opendaylight:test:recursive"
915         },
916         "description": "",
917         "title": "recursive_container-root",
918         "type": "object"
919       }
920     },
921     "securitySchemes": {
922       "basicAuth": {
923         "scheme": "basic",
924         "type": "http"
925       }
926     }
927   },
928   "security": [
929     {
930       "basicAuth": []
931     }
932   ]
933 }