Commit ad8291b 1 parent 9245007 commit ad8291b Copy full SHA for ad8291b
File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1380,4 +1380,33 @@ type: object
1380
1380
let structs = analyze ( schema, "Reference" , Cfg :: default ( ) ) . unwrap ( ) . 0 ;
1381
1381
assert_eq ! ( structs[ 0 ] . members[ 0 ] . type_, "Option<Vec<ObjectReference>>" ) ;
1382
1382
}
1383
+
1384
+ #[ test]
1385
+ fn list_of_lists ( ) {
1386
+ init ( ) ;
1387
+ let schema_str = r#"
1388
+ properties:
1389
+ mounts:
1390
+ description: mounts specifies a list of mount points to be setup.
1391
+ items:
1392
+ description: MountPoints defines input for generated mounts in cloud-init.
1393
+ items:
1394
+ type: string
1395
+ type: array
1396
+ type: array
1397
+ type: object
1398
+ "# ;
1399
+
1400
+ let schema: JSONSchemaProps = serde_yaml:: from_str ( schema_str) . unwrap ( ) ;
1401
+
1402
+ let structs = analyze ( schema, "KubeadmConfig" , Cfg :: default ( ) ) . unwrap ( ) . 0 ;
1403
+
1404
+ let root = & structs[ 0 ] ;
1405
+ assert_eq ! ( root. name, "KubeadmConfig" ) ;
1406
+ assert_eq ! ( root. level, 0 ) ;
1407
+
1408
+ let map = & root. members [ 0 ] ;
1409
+ assert_eq ! ( map. name, "mounts" ) ;
1410
+ assert_eq ! ( map. type_, "Option<Vec<Vec<String>>>" ) ;
1411
+ }
1383
1412
}
You can’t perform that action at this time.
0 commit comments