BUG-4355: mandatory node presence enforcement
[yangtools.git] / yang / yang-data-impl / src / test / resources / mandatory-leaf-test.yang
1 module mandatory-leaf-test {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test";
4     prefix "store-test";
5
6     revision "2014-03-13" {
7         description "Initial revision.";
8     }
9
10     container test {
11         presence true;
12         config true;
13         choice choice1 {
14             case case1 {
15                 leaf case1-leaf1 {
16                     type string;
17                 }
18             }
19             case case2 {
20                 container case2-cont {
21                     leaf case2-leaf1 {
22                         mandatory true;
23                         type string;
24                     }
25                     leaf case2-leaf2 {
26                         type string;
27                     }
28                 }
29             }
30         }
31
32         list outer-list {
33
34             key id;
35             leaf id {
36                 type uint16;
37             }
38             choice outer-choice {
39                 case one {
40                     leaf one {
41                         type string;
42                     }
43                 }
44                 case two-three {
45                     leaf two {
46                         type string;
47                     }
48                     leaf three {
49                         type string;
50                     }
51                 }
52             }
53             list inner-list {
54                 key name;
55                 leaf name {
56                     type string;
57                 }
58                 leaf value {
59                     type string;
60                 }
61             }
62
63             list inner-list2 {
64                 key name;
65                 leaf name {
66                     type string;
67                 }
68                 leaf value {
69                     type string;
70                 }
71             }
72         }
73     }
74 }