Open
Description
I'm finding that if I do a:
err = lyd_new_path2(NULL, ly_native_ctx, xpath, NULL, 0, 0,
LYD_NEW_PATH_UPDATE, NULL, trunk);
where xpath is a path that ends in a keyless list entry with a positional predicate (e.g., /foos/foo[2]
) I get a new node back. This must be a bug b/c i'm starting from an empty tree and asking for the second node in a keyless list. It's returning a single list node with no siblings IOW /foos/foo[1]
.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
choppsv1 commentedon Jan 7, 2025
FWIW same issue exists when
foo
is a leaf-list.michalvasko commentedon Jan 7, 2025
What exactly would you expect to happen in your use-case? The only unexpected (undocumented) behavior is that any invalid indices are always normalized to the closest valid index, in this case
2
->1
. In other words, any index higher than the current number of instances causes a new instance to be created.choppsv1 commentedon Jan 7, 2025
tree data UPDATE error on invalid new_path position
michalvasko commentedon Jan 8, 2025
The very first time someone complains about this but I have no issue with whichever functioning so an error should now be printed.