Hi,
I am trying to make a leaf node as conditional mandatory as explained below.
list top-list {
leaf type {
description "type.";
mandatory true;
type network-type; /// this type has 3 values i.e local/remote/gr-remote
}
leaf node {
description "Node details.";
type leafref {
path /// -- some reference
}
mandatory true;
when "../type = 'local'";
}
}
Now here, the ask is to have node as mandatory when type is local and optional when type is gr-remote and not allowed when type is local.
I am able to make both local & gr-remote as either mandatory or option via using "when" but not able to make leaf "node" as mandatory when type is "local" and optional when type is "gr-remote".
Any leads on this would be helpful.
Thank in advance.
Regards
Nikhil