Closed majakizic closed 4 years ago
Hi @majakijic, can you elaborate on what you'd like to see as expected toString output? Is the issue that the sub statements for the submodule is no longer present after being included by the main module?
Hi, thanks for the reply. yes, I think that is the issue. What I would expect to see from the toString is the original module content without submodule’s elements and the original content of the submodule as well.
The schema is still valid but it would be useful to tag submodule’s elements in the yang object so that it is possible to associate those with the included submodule.
There is also an another issue with the toString that I just noticed, the multiple keys in a list are comma separated
list bar {
key 'b1,b2';
leaf b1 {
type uint16;
}
leaf b2 {
type uint16;
}
}
Hi @majakizic I think for your use case, perhaps what you want to do is import YANG schema without compiling?
Yang.import('ex-1.yang', { compile: false });
When you use Yang.import
it will compile the schema, which will modify the schema during the process such as attaching definitions and such from include
statements.
The issue with key
being serialized with commas is definitely a bug and I will address that one.
ok, thanks so much for your help.
Hi
There is an issue in toString() method when printing a module that includes a submodule. The issue is that the printout contains an entire schema , for example:
file ex1.yang:
file ex1-sub.yang:
console.log(Yang.import('ex1.yang').toString()); console.log(Yang.import('ex1-sub.yang').toString());
results in following:
Is it possible to tag submodule element so that the toString matches the original module?