I have the following simple yang files. I was trying to get a tree output that consolidates the module and submodule, but, cant get.
module modA {
yang-version 1.1;
namespace "http://www.example.com/";
prefix ma;
container c {
leaf l {
type string;
}
}
}
and
submodule sub1 {
yang-version 1.1;
belongs-to "modA" {
prefix mA;
}
container sub-container {
leaf l {
type string;
}
}
}
I tried the libyang/yanglint but, it failed with the following error :
add sub1.yang libyang[0]: Unable to parse submodule, parse the main module instead.
earlier, I tried with pyang too, but, not seeing a single tree that combines both yang files.
And, I tried a duplicate node in the submodule, like so:
module a {
container c {}
}
submodule b {
belongs-to a;
container c {}; // I was expecting this to fail because this will clash
// with the container c in the module. But, pyang compilation went through without error. Is my expectation wrong?
}