tree data BUGFIX do not require string value in dictionary
... when using them in any node values. It was not
documented and redundant.
diff --git a/src/tree_data.c b/src/tree_data.c
index b1106ff..2ab998e 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -810,7 +810,19 @@
/* TODO: convert XML/JSON strings into a opaq data tree */
if (use_value) {
- any->value.str = value;
+ switch (value_type) {
+ case LYD_ANYDATA_DATATREE:
+ any->value.tree = (void *)value;
+ break;
+ case LYD_ANYDATA_STRING:
+ case LYD_ANYDATA_XML:
+ case LYD_ANYDATA_JSON:
+ lydict_insert_zc(schema->module->ctx, (void *)value, &any->value.str);
+ break;
+ case LYD_ANYDATA_LYB:
+ any->value.mem = (void *)value;
+ break;
+ }
any->value_type = value_type;
} else {
any_val.str = value;