Fixed RESTConf support for identity-ref build-in datatype
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / resources / yang-to-json-conversion / simple-data-types / simple-data-types.yang
1 module simple-data-types {
2   namespace "simple:data:types";  
3
4   prefix "smpdtp";
5   revision 2013-11-12 {    
6   }
7   
8   typedef tpdfempty {
9         type empty;
10   }
11   
12   typedef tpdfbit {
13         type bits {
14                 bit b1;
15                 bit b2;
16                 bit b3;
17         }
18   }
19   
20   typedef tpdfun4 {
21         type boolean;
22   }
23   
24   typedef tpdfun3 {
25         type union {
26                 type tpdfbit;
27                 type tpdfempty;
28         }
29   }  
30   
31   typedef tpdfun2 {
32         type union {
33                 type tpdfun3;
34                 type tpdfun4;
35         }
36   }
37   
38   typedef tpdfun1 {
39         type union {
40                 type uint8;
41                 type decimal64 {
42                         fraction-digits 2;
43                 }
44         }
45   }
46   
47   container cont {
48           leaf lfnint8Min {
49                 type int8; 
50           }
51           leaf lfnint8Max {
52                 type int8; 
53           }
54           leaf lfnint16Min {
55                 type int16; 
56           }
57           leaf lfnint16Max {
58                 type int16; 
59           }
60           leaf lfnint32Min {
61                 type int32; 
62           }
63           leaf lfnint32Max {
64                 type int32; 
65           }
66           leaf lfnint64Min {
67                 type int64; 
68           }
69           leaf lfnint64Max {
70                 type int64; 
71           }
72           
73           leaf lfnuint8Max {
74                 type uint8; 
75           }
76           leaf lfnuint16Max {
77                 type uint16; 
78           }
79           leaf lfnuint32Max {
80                 type uint32; 
81           }
82           leaf lfuint64Max {
83                 type uint64; 
84           }
85           leaf lfstr {
86                 type string;
87           }       
88           leaf lfstr1 {
89                 type string;
90           }       
91           leaf lfbool1 {
92                 type boolean;
93           }       
94           leaf lfbool2 {
95                 type boolean;
96           }       
97           leaf lfbool3 {
98                 type boolean;
99           }       
100           leaf lfdecimal1 {
101                 type decimal64 {
102                         fraction-digits 2;
103                 }       
104           }       
105           leaf lfdecimal2 {
106                 type decimal64 {
107                         fraction-digits 2;
108                 }       
109           }       
110           leaf lfdecimal3 {
111                 type decimal64 {
112                         fraction-digits 2;
113                 }       
114           }      
115            
116           leaf lfdecimal4 {
117                 type decimal64 {
118                         fraction-digits 2;
119                 }       
120           }
121                   
122           
123           leaf lfdecimal6 {
124                 type decimal64 {
125                         fraction-digits 2;
126                 }       
127           }       
128
129     leaf lfenum {
130       type enumeration {
131         enum enum1;
132         enum enum2;
133         enum enum3;
134         enum enum4;
135       }
136     }
137
138     leaf lfbits {
139       type bits {
140         bit bit1;
141         bit bit2;
142         bit bit3;
143         bit bit4;
144       }
145     }   
146     
147     leaf lfbinary {
148         type binary;
149     }  
150     
151     leaf lfref1 {                  //reference to string type
152         type leafref {
153                 path "../lfstr";
154         }
155     }
156     
157     leaf lfref2 {                  //reference to number type
158         type leafref {
159                 path "../lfnint8Max";
160         }
161     }
162     
163     leaf lfempty {
164         type empty;
165     }
166     
167     leaf lfunion1 {
168         type union {
169                 type uint16;
170                 type string;
171         }
172     }
173     leaf lfunion2 {
174         type union {
175                 type decimal64 {
176                                 fraction-digits 2;              
177                 }
178                 type string;
179         }
180     }
181     
182     leaf lfunion3 {
183         type union {
184                 type empty;
185                 type string;
186         }
187     }
188     
189     leaf lfunion4 {
190         type union {
191                 type boolean;
192                 type string;
193         }
194     }
195     
196     leaf lfunion5 {
197         type union {
198                 type uint16;
199                 type string;
200         }
201     }
202     
203     leaf lfunion6 {
204         type union {
205                 type uint16;
206                 type empty;
207         }
208     }
209     
210     leaf lfunion7 {
211                 type tpdfun3;
212     }
213     
214     leaf lfunion8 {
215         type union {
216                 type uint16;
217                 type string;
218         }
219     }
220     
221     leaf lfunion9 {
222         type union {
223                 type uint16;
224                 type boolean;                   
225         }
226     }
227     
228     leaf lfunion10 {
229         type union {
230                 type bits {
231                         bit bt1;
232                         bit bt2;
233                 }
234                 type boolean;                   
235         }
236     }
237     
238     leaf lfunion11 {
239                 type union {
240                         type tpdfun1;
241                         type tpdfun2;
242                 }
243     }
244     
245     leaf lfunion12 {
246                 type tpdfun2;
247     }
248           
249           
250   }
251 }