Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

*Although this documentation link is to the latest ODL doc revision, it is very outdated and the code examples need significant updates, see findings in Mini-PoC below (bug reported: https://jira.opendaylight.org/browse/DOCS-126)

Overview

The Yang parser used in ONAP (CCSDK / SDNC) was developed (and still is) a OpenDayLight Library.

...

The sample code provided in the documentation is faulty (using == for assigning?!) and is using some long deprecated and even removed classes and methods.

Bug reported: https://jira.opendaylight.org/browse/DOCS-126

Code Block
languagejava
themeMidnight
titleCorrected Code
linenumberstrue
collapsetrue
        YangTextSchemaSource source = YangTextSchemaSource.forFile(new File("/example.yang"));
        StatementStreamSource yangModuleSource = YangStatementStreamSource.create(source);

        CrossSourceStatementReactor.BuildAction reactor = defaultReactor().newBuild();
        reactor.addSource(yangModuleSource);

        SchemaContext schemaContext = reactor.buildEffective();

        Set<Module> modules = schemaContext.getModules();
        Set<DataSchemaNode> dataSchemaNodes = schemaContext.getDataDefinitions();

...