-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
None
-
None
version: Magnesium
page: developer-guide/yang-tools
While trying out this developers guide (as I want to start using the Yang tools) I realized the code in the example no longer matches the current libraries
I suspect the content of this page hasn't been updated for a while. I am not sure if the diagrams are still correct but some of the code definitely is wrong. Some examples
1) new YangStatementSourceImpl("/example.yang", false); I
This is no longer a valid contructor. Instead the code should be something like this:
YangTextSchemaSource source = YangTextSchemaSource.forFile(new File("/exampleI.yang"));
StatementStreamSource yangModuleSource = YangStatementStreamSource.create(source);
2) YangInferencePipeline.RFC6020_REACTOR.newBuild(); refers to a class that no longer exists!
instead I used
CrossSourceStatementReactor.BuildAction reactor = RFC7950Reactors.defaultReactor().newBuild();
3) Set<DataSchemaNodes> dataSchemaNodes = schemaContext.getDataDefinitions();
Is might just be a typo but DataSchemaNodes (plural) is incorrect, it should be
Set<DataSchemaNode> dataSchemaNodes = schemaContext.getDataDefinitions();
4) Note the use of double == instead of =
I suspect there are more issues with the remainder of the code but I didn't explore. Its probably best left to someone that is familiar with yang tools to reproduce all the samples using the current libraries and update the code (and possibly diagrams)