mirror of
https://github.com/libvirt/libvirt.git
synced 2026-08-11 13:34:45 -05:00
util: json: Properly implement JSON deflattening
As it turns out sometimes users pass in an arbitrarily nested structure e.g. for the qemu backing chains JSON pseudo protocol. This new implementation deflattens now a single object fully even with nested keys. Additionally it's not necessary now to stick with the "file." prefix for the properties.
This commit is contained in:
+4
-4
@@ -512,13 +512,13 @@ mymain(void)
|
||||
|
||||
DO_TEST_DEFLATTEN("unflattened", true);
|
||||
DO_TEST_DEFLATTEN("basic-file", true);
|
||||
DO_TEST_DEFLATTEN("basic-generic", false);
|
||||
DO_TEST_DEFLATTEN("basic-generic", true);
|
||||
DO_TEST_DEFLATTEN("deep-file", true);
|
||||
DO_TEST_DEFLATTEN("deep-generic", false);
|
||||
DO_TEST_DEFLATTEN("deep-generic", true);
|
||||
DO_TEST_DEFLATTEN("nested", true);
|
||||
DO_TEST_DEFLATTEN("double-key", true);
|
||||
DO_TEST_DEFLATTEN("double-key", false);
|
||||
DO_TEST_DEFLATTEN("concat", true);
|
||||
DO_TEST_DEFLATTEN("concat-double-key", true);
|
||||
DO_TEST_DEFLATTEN("concat-double-key", false);
|
||||
|
||||
return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user