5d59dc62522abc179b46c35ea002c636075f3709
[netconf.git] / restconf / restconf-openapi / src / test / resources / yang-document / device-definition-test.json
1 {
2   "openapi": "3.0.3",
3   "info": {
4     "version": "1.0.0",
5     "title": "definition-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/nodes/node=123/yang-ext:mount/definition-test:binary-container": {
15       "get": {
16         "tags": [
17           "123 definition-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/definition-test_binary-container"
41                 }
42               },
43               "application/json": {
44                 "schema": {
45                   "properties": {
46                     "binary-container": {
47                       "$ref": "#/components/schemas/definition-test_binary-container",
48                       "type": "object"
49                     }
50                   }
51                 }
52               }
53             }
54           }
55         },
56         "description": "",
57         "summary": "GET - 123 - definition-test - binary-container"
58       },
59       "put": {
60         "tags": [
61           "123 definition-test"
62         ],
63         "parameters": [],
64         "requestBody": {
65           "description": "binary-container",
66           "content": {
67             "application/xml": {
68               "schema": {
69                 "$ref": "#/components/schemas/definition-test_binary-container"
70               }
71             },
72             "application/json": {
73               "schema": {
74                 "properties": {
75                   "definition-test:binary-container": {
76                     "$ref": "#/components/schemas/definition-test_binary-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 - definition-test - 123 - binary-container"
94       },
95       "delete": {
96         "tags": [
97           "123 definition-test"
98         ],
99         "parameters": [],
100         "responses": {
101           "204": {
102             "description": "Deleted"
103           }
104         },
105         "description": "",
106         "summary": "DELETE - 123 - definition-test - binary-container"
107       },
108       "patch": {
109         "tags": [
110           "123 definition-test"
111         ],
112         "parameters": [],
113         "requestBody": {
114           "description": "binary-container",
115           "content": {
116             "application/yang-data+json": {
117               "schema": {
118                 "properties": {
119                   "definition-test:binary-container": {
120                     "$ref": "#/components/schemas/definition-test_binary-container",
121                     "type": "object"
122                   }
123                 }
124               }
125             },
126             "application/yang-data+xml": {
127               "schema": {
128                 "$ref": "#/components/schemas/definition-test_binary-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 - definition-test - 123 - binary-container"
143       }
144     },
145     "/rests/data/nodes/node=123/yang-ext:mount/definition-test:network-container": {
146       "get": {
147         "tags": [
148           "123 definition-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/definition-test_network-container"
172                 }
173               },
174               "application/json": {
175                 "schema": {
176                   "properties": {
177                     "network-container": {
178                       "$ref": "#/components/schemas/definition-test_network-container",
179                       "type": "object"
180                     }
181                   }
182                 }
183               }
184             }
185           }
186         },
187         "description": "",
188         "summary": "GET - 123 - definition-test - network-container"
189       },
190       "put": {
191         "tags": [
192           "123 definition-test"
193         ],
194         "parameters": [],
195         "requestBody": {
196           "description": "network-container",
197           "content": {
198             "application/xml": {
199               "schema": {
200                 "$ref": "#/components/schemas/definition-test_network-container"
201               }
202             },
203             "application/json": {
204               "schema": {
205                 "properties": {
206                   "definition-test:network-container": {
207                     "$ref": "#/components/schemas/definition-test_network-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 - definition-test - 123 - network-container"
225       },
226       "delete": {
227         "tags": [
228           "123 definition-test"
229         ],
230         "parameters": [],
231         "responses": {
232           "204": {
233             "description": "Deleted"
234           }
235         },
236         "description": "",
237         "summary": "DELETE - 123 - definition-test - network-container"
238       },
239       "patch": {
240         "tags": [
241           "123 definition-test"
242         ],
243         "parameters": [],
244         "requestBody": {
245           "description": "network-container",
246           "content": {
247             "application/yang-data+json": {
248               "schema": {
249                 "properties": {
250                   "definition-test:network-container": {
251                     "$ref": "#/components/schemas/definition-test_network-container",
252                     "type": "object"
253                   }
254                 }
255               }
256             },
257             "application/yang-data+xml": {
258               "schema": {
259                 "$ref": "#/components/schemas/definition-test_network-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 - definition-test - 123 - network-container"
274       }
275     },
276     "/rests/data/nodes/node=123/yang-ext:mount/definition-test:number-container": {
277       "get": {
278         "tags": [
279           "123 definition-test"
280         ],
281         "parameters": [
282           {
283             "name": "content",
284             "in": "query",
285             "required": false,
286             "schema": {
287               "enum": [
288                 "config",
289                 "nonconfig",
290                 "all"
291               ],
292               "type": "string"
293             }
294           }
295         ],
296         "responses": {
297           "200": {
298             "description": "200",
299             "content": {
300               "application/xml": {
301                 "schema": {
302                   "$ref": "#/components/schemas/definition-test_number-container"
303                 }
304               },
305               "application/json": {
306                 "schema": {
307                   "properties": {
308                     "number-container": {
309                       "$ref": "#/components/schemas/definition-test_number-container",
310                       "type": "object"
311                     }
312                   }
313                 }
314               }
315             }
316           }
317         },
318         "description": "",
319         "summary": "GET - 123 - definition-test - number-container"
320       },
321       "put": {
322         "tags": [
323           "123 definition-test"
324         ],
325         "parameters": [],
326         "requestBody": {
327           "description": "number-container",
328           "content": {
329             "application/xml": {
330               "schema": {
331                 "$ref": "#/components/schemas/definition-test_number-container"
332               }
333             },
334             "application/json": {
335               "schema": {
336                 "properties": {
337                   "definition-test:number-container": {
338                     "$ref": "#/components/schemas/definition-test_number-container",
339                     "type": "object"
340                   }
341                 }
342               }
343             }
344           }
345         },
346         "responses": {
347           "204": {
348             "description": "Updated"
349           },
350           "201": {
351             "description": "Created"
352           }
353         },
354         "description": "",
355         "summary": "PUT - definition-test - 123 - number-container"
356       },
357       "delete": {
358         "tags": [
359           "123 definition-test"
360         ],
361         "parameters": [],
362         "responses": {
363           "204": {
364             "description": "Deleted"
365           }
366         },
367         "description": "",
368         "summary": "DELETE - 123 - definition-test - number-container"
369       },
370       "patch": {
371         "tags": [
372           "123 definition-test"
373         ],
374         "parameters": [],
375         "requestBody": {
376           "description": "number-container",
377           "content": {
378             "application/yang-data+json": {
379               "schema": {
380                 "properties": {
381                   "definition-test:number-container": {
382                     "$ref": "#/components/schemas/definition-test_number-container",
383                     "type": "object"
384                   }
385                 }
386               }
387             },
388             "application/yang-data+xml": {
389               "schema": {
390                 "$ref": "#/components/schemas/definition-test_number-container"
391               }
392             }
393           }
394         },
395         "responses": {
396           "200": {
397             "description": "OK"
398           },
399           "204": {
400             "description": "Updated"
401           }
402         },
403         "description": "",
404         "summary": "PATCH - definition-test - 123 - number-container"
405       }
406     },
407     "/rests/data/nodes/node=123/yang-ext:mount/definition-test:enum-container": {
408       "get": {
409         "tags": [
410           "123 definition-test"
411         ],
412         "parameters": [
413           {
414             "name": "content",
415             "in": "query",
416             "required": false,
417             "schema": {
418               "enum": [
419                 "config",
420                 "nonconfig",
421                 "all"
422               ],
423               "type": "string"
424             }
425           }
426         ],
427         "responses": {
428           "200": {
429             "description": "200",
430             "content": {
431               "application/xml": {
432                 "schema": {
433                   "$ref": "#/components/schemas/definition-test_enum-container"
434                 }
435               },
436               "application/json": {
437                 "schema": {
438                   "properties": {
439                     "enum-container": {
440                       "$ref": "#/components/schemas/definition-test_enum-container",
441                       "type": "object"
442                     }
443                   }
444                 }
445               }
446             }
447           }
448         },
449         "description": "",
450         "summary": "GET - 123 - definition-test - enum-container"
451       },
452       "put": {
453         "tags": [
454           "123 definition-test"
455         ],
456         "parameters": [],
457         "requestBody": {
458           "description": "enum-container",
459           "content": {
460             "application/xml": {
461               "schema": {
462                 "$ref": "#/components/schemas/definition-test_enum-container"
463               }
464             },
465             "application/json": {
466               "schema": {
467                 "properties": {
468                   "definition-test:enum-container": {
469                     "$ref": "#/components/schemas/definition-test_enum-container",
470                     "type": "object"
471                   }
472                 }
473               }
474             }
475           }
476         },
477         "responses": {
478           "204": {
479             "description": "Updated"
480           },
481           "201": {
482             "description": "Created"
483           }
484         },
485         "description": "",
486         "summary": "PUT - definition-test - 123 - enum-container"
487       },
488       "delete": {
489         "tags": [
490           "123 definition-test"
491         ],
492         "parameters": [],
493         "responses": {
494           "204": {
495             "description": "Deleted"
496           }
497         },
498         "description": "",
499         "summary": "DELETE - 123 - definition-test - enum-container"
500       },
501       "patch": {
502         "tags": [
503           "123 definition-test"
504         ],
505         "parameters": [],
506         "requestBody": {
507           "description": "enum-container",
508           "content": {
509             "application/yang-data+json": {
510               "schema": {
511                 "properties": {
512                   "definition-test:enum-container": {
513                     "$ref": "#/components/schemas/definition-test_enum-container",
514                     "type": "object"
515                   }
516                 }
517               }
518             },
519             "application/yang-data+xml": {
520               "schema": {
521                 "$ref": "#/components/schemas/definition-test_enum-container"
522               }
523             }
524           }
525         },
526         "responses": {
527           "200": {
528             "description": "OK"
529           },
530           "204": {
531             "description": "Updated"
532           }
533         },
534         "description": "",
535         "summary": "PATCH - definition-test - 123 - enum-container"
536       }
537     },
538     "/rests/data/nodes/node=123/yang-ext:mount/definition-test:union-container": {
539       "get": {
540         "tags": [
541           "123 definition-test"
542         ],
543         "parameters": [
544           {
545             "name": "content",
546             "in": "query",
547             "required": false,
548             "schema": {
549               "enum": [
550                 "config",
551                 "nonconfig",
552                 "all"
553               ],
554               "type": "string"
555             }
556           }
557         ],
558         "responses": {
559           "200": {
560             "description": "200",
561             "content": {
562               "application/xml": {
563                 "schema": {
564                   "$ref": "#/components/schemas/definition-test_union-container"
565                 }
566               },
567               "application/json": {
568                 "schema": {
569                   "properties": {
570                     "union-container": {
571                       "$ref": "#/components/schemas/definition-test_union-container",
572                       "type": "object"
573                     }
574                   }
575                 }
576               }
577             }
578           }
579         },
580         "description": "",
581         "summary": "GET - 123 - definition-test - union-container"
582       },
583       "put": {
584         "tags": [
585           "123 definition-test"
586         ],
587         "parameters": [],
588         "requestBody": {
589           "description": "union-container",
590           "content": {
591             "application/xml": {
592               "schema": {
593                 "$ref": "#/components/schemas/definition-test_union-container"
594               }
595             },
596             "application/json": {
597               "schema": {
598                 "properties": {
599                   "definition-test:union-container": {
600                     "$ref": "#/components/schemas/definition-test_union-container",
601                     "type": "object"
602                   }
603                 }
604               }
605             }
606           }
607         },
608         "responses": {
609           "204": {
610             "description": "Updated"
611           },
612           "201": {
613             "description": "Created"
614           }
615         },
616         "description": "",
617         "summary": "PUT - definition-test - 123 - union-container"
618       },
619       "delete": {
620         "tags": [
621           "123 definition-test"
622         ],
623         "parameters": [],
624         "responses": {
625           "204": {
626             "description": "Deleted"
627           }
628         },
629         "description": "",
630         "summary": "DELETE - 123 - definition-test - union-container"
631       },
632       "patch": {
633         "tags": [
634           "123 definition-test"
635         ],
636         "parameters": [],
637         "requestBody": {
638           "description": "union-container",
639           "content": {
640             "application/yang-data+json": {
641               "schema": {
642                 "properties": {
643                   "definition-test:union-container": {
644                     "$ref": "#/components/schemas/definition-test_union-container",
645                     "type": "object"
646                   }
647                 }
648               }
649             },
650             "application/yang-data+xml": {
651               "schema": {
652                 "$ref": "#/components/schemas/definition-test_union-container"
653               }
654             }
655           }
656         },
657         "responses": {
658           "200": {
659             "description": "OK"
660           },
661           "204": {
662             "description": "Updated"
663           }
664         },
665         "description": "",
666         "summary": "PATCH - definition-test - 123 - union-container"
667       }
668     },
669     "/rests/data/nodes/node=123/yang-ext:mount": {
670       "post": {
671         "tags": [
672           "123 definition-test"
673         ],
674         "parameters": [],
675         "requestBody": {
676           "description": "binary-container",
677           "content": {
678             "application/xml": {
679               "schema": {
680                 "$ref": "#/components/schemas/definition-test_binary-container"
681               }
682             },
683             "application/json": {
684               "schema": {
685                 "properties": {
686                   "binary-container": {
687                     "$ref": "#/components/schemas/definition-test_binary-container",
688                     "type": "object"
689                   }
690                 }
691               }
692             }
693           }
694         },
695         "responses": {
696           "201": {
697             "description": "Created"
698           }
699         },
700         "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",
701         "summary": "POST - 123 - definition-test - definition-test"
702       }
703     }
704   },
705   "components": {
706     "schemas": {
707       "definition-test_union-container": {
708         "properties": {
709           "testUnion3": {
710             "default": "false",
711             "description": "",
712             "type": "integer",
713             "example": -2147483648,
714             "format": "int32"
715           },
716           "testUnion1": {
717             "default": "5",
718             "description": "",
719             "type": "integer",
720             "example": -2147483648,
721             "format": "int32"
722           },
723           "testUnion2": {
724             "default": "false",
725             "description": "",
726             "type": "string",
727             "example": "Some testUnion2"
728           },
729           "testBoolean": {
730             "default": true,
731             "description": "",
732             "type": "boolean",
733             "example": true
734           }
735         },
736         "xml": {
737           "name": "union-container",
738           "namespace": "urn:definition-test"
739         },
740         "description": "",
741         "title": "definition-test_union-container",
742         "type": "object"
743       },
744       "definition-test_number-container": {
745         "properties": {
746           "testInteger": {
747             "default": 42,
748             "description": "",
749             "type": "integer",
750             "example": -2147483648,
751             "format": "int32"
752           },
753           "testDecimal": {
754             "default": 3.14,
755             "description": "",
756             "type": "number",
757             "example": -92233720368547758.08
758           },
759           "testInt64": {
760             "default": 42,
761             "description": "",
762             "type": "integer",
763             "example": -9223372036854775808,
764             "format": "int64"
765           },
766           "testDouble": {
767             "default": 3.14159265359,
768             "description": "",
769             "type": "number",
770             "example": -92233720.36854775808
771           },
772           "testUint64": {
773             "default": 42,
774             "description": "",
775             "type": "integer",
776             "example": 0
777           },
778           "testUnsignedInteger": {
779             "default": 100,
780             "description": "",
781             "type": "integer",
782             "example": 0,
783             "format": "int32"
784           }
785         },
786         "xml": {
787           "name": "number-container",
788           "namespace": "urn:definition-test"
789         },
790         "description": "",
791         "title": "definition-test_number-container",
792         "type": "object"
793       },
794       "definition-test_network-container": {
795         "properties": {
796           "network-ref": {
797             "default": "/network/nodes[node-id='node1']",
798             "description": "",
799             "type": "string",
800             "example": "/sample:binary-container"
801           }
802         },
803         "xml": {
804           "name": "network-container",
805           "namespace": "urn:definition-test"
806         },
807         "description": "",
808         "title": "definition-test_network-container",
809         "type": "object"
810       },
811       "definition-test_enum-container": {
812         "properties": {
813           "status": {
814             "default": "up",
815             "enum": [
816               "up",
817               "down"
818             ],
819             "description": "",
820             "type": "string",
821             "example": "up"
822           }
823         },
824         "xml": {
825           "name": "enum-container",
826           "namespace": "urn:definition-test"
827         },
828         "description": "",
829         "title": "definition-test_enum-container",
830         "type": "object"
831       },
832       "definition-test_binary-container": {
833         "properties": {
834           "binary-data": {
835             "default": "SGVsbG8gdGVzdCE=",
836             "description": "",
837             "type": "string",
838             "format": "byte"
839           }
840         },
841         "xml": {
842           "name": "binary-container",
843           "namespace": "urn:definition-test"
844         },
845         "description": "",
846         "title": "definition-test_binary-container",
847         "type": "object"
848       }
849     },
850     "securitySchemes": {
851       "basicAuth": {
852         "scheme": "basic",
853         "type": "http"
854       }
855     }
856   },
857   "security": [
858     {
859       "basicAuth": []
860     }
861   ]
862 }