Open
Description
I am trying to work with the AST of a module. I am loading the following YANG using parser.LoadModule
module myModule {
yang-version "1.1";
namespace "http://myModule.com/ns/yang/eth_dm";
prefix "myModule";
organization "myOrg";
revision 2024-02-26 {
description
"Newly generated revision";
reference "1.0.0";
}
augment "/otherModule:object-type" {
when "/otherModule:object-type/otherModule:typename = 'eth-dm'";
container eth-dm {
uses monitored-objects;
}
}
grouping monitored-objects {
container monitored-objects {
list monitored-object {
key "monitored-object-id monitored-object-name";
}
}
}
}
Trying to access they key
of the monitored-objects list is not possible
module.Groupings()["monitored-objects"].DataDefinitions()[0].(*meta.Container).DataDefinitions()[0].(*meta.List).KeyMeta()
is returning nil
.
The private key
property of meta.List
is populated, but I noticed that the entire container monitored-objects
is not compiled because it is only referenced by the augment and not a by container rooted in the module. Therefore, the code which is populating the keyMeta
property of meta.List
isn't executed. Which also means that I can provide a key that is referencing a non-existent leaf without getting any compile errors on LoadModule
.
Metadata
Assignees
Labels
No labels
Activity