[YANGTOOLS-857] YANG parser should honor RFC7950 section 6.2.1 restrictions Created: 02/Mar/18 Updated: 19/Oct/19 Resolved: 09/Oct/19 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | parser |
| Affects Version/s: | 2.1.12, 3.0.5, 4.0.1 |
| Fix Version/s: | 3.0.6, 2.1.13, 4.0.2 |
| Type: | Bug | Priority: | Medium |
| Reporter: | Jie Han | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
As in RFC 7950 section 6.2.1:
We should take into consideration the following 3 models:
module bar {
yang-version 1.1;
namespace bar;
prefix bar;
revision "2018-02-11";
grouping foo {
container bar {
}
}
container cont {
choice bar {
case foo {
uses foo;
}
}
}
augment "/cont" {
choice foo {
case foo {
uses foo;
}
}
}
}
module baz {
yang-version 1.1;
namespace baz;
prefix baz;
revision "2018-02-28";
grouping foo {
container bar {
}
}
container cont {
choice bar {
case foo {
uses foo;
}
}
container bar {
}
}
}
module foo {
yang-version 1.1;
namespace foo;
prefix foo;
revision "2018-02-11";
grouping foo {
container bar {
}
}
container cont {
choice bar {
case foo {
uses foo;
}
}
}
augment "/cont/bar" {
case foo2 {
uses foo;
}
}
}
|
| Comments |
| Comment by Jie Han [ 02/Mar/18 ] |
| Comment by Robert Varga [ 13/Jun/18 ] |
|
This namespace is not really useful to end users, as it is a hybrid between schema tree and data tree addressing. Notable difference from schema tree addressing: choices/cases and their data nodes are flattened to their ancestor node (as highlighted in the description). Notable difference from data tree addressing: choices/cases contribute to the hierarchy.
|
| Comment by Robert Varga [ 08/Oct/19 ] |
|
It seems YANGTOOLS-853 implementation is missing dataTree population. Using the attached test case container's dataTreeNamespace is empty – where it should contain all leaves of choice/case statements. It correctly lists ChoiceNode in its schemaTreeNamespace. Furthermore the ChoiceNode has its dataTreeNamespace empty, too. |
| Comment by Robert Varga [ 08/Oct/19 ] |
|
Ah, right, so LeafEffectiveStatement is just a SchemaTreeEffectiveStatement, not DataTreeEffectiveStatement – and thus was not attributed correctly. |