common BUGFIX do not insert list keys
@@ -4695,6 +4695,10 @@ sr_lyd_get_enabled_xpath(struct lyd_node **data, char **xpaths, uint16_t xp_coun
*data = (*data)->next;
}
+ if (lysc_is_key(set->dnodes[i]->schema)) {
+ /* keys are duplicated automatically and cannot be inserted */
+ root = parent;
+ } else {
/* relink into parent, if any */
lyd_unlink_tree(src);
if (parent && lyd_insert_child(parent, src)) {
@@ -4704,6 +4708,7 @@ sr_lyd_get_enabled_xpath(struct lyd_node **data, char **xpaths, uint16_t xp_coun
root = src;
}
+ }
/* find top-level root */
while (root->parent) {
