[MDSAL-310] Instance Identifier is unable to represent Choice / Case, only children Created: 01/Aug/14 Updated: 13/Sep/18 Resolved: 13/Sep/18 |
|
| Status: | Resolved |
| Project: | mdsal |
| Component/s: | Binding V2 codegen, Binding V2 runtime |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Medium |
| Reporter: | Tony Tkacik | Assignee: | Jie Han |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Issue Links: |
|
||||||||||||||||
| External issue ID: | 1466 | ||||||||||||||||
| Description |
|
It is impossible to construct instance identifier, which will explicitly reference choice / case. This makes binding instance identifier not suffiecient expresive, Module 1: } choice bar { } Module 2 augment bar { } |
| Comments |
| Comment by Vratko Polak [ 27/Oct/15 ] |
|
> in following situation This is very similar to description of "two sibling nodes with the same local name" in https://tools.ietf.org/html/draft-lhotka-netmod-yang-json-02#section-3.1 How does ODL distinguish "foomod:bar" from "barmod:bar" (leafs in that link), and why does it not work for distinguishing "module1:bar" from "module2:bar" (inner containers in this Bug)? |
| Comment by Jie Han [ 07/Feb/18 ] |
|
See RFC 7950 section 6.2.1:
So, the yang defined above seems illegal as there're two 'bar' containers. |
| Comment by Jie Han [ 11/Feb/18 ] |
|
Detection of node name collision should be completed by yangtool parser, move this bug to YANGTOOLS. |
| Comment by Jie Han [ 12/Feb/18 ] |
| Comment by Robert Varga [ 14/Feb/18 ] |
|
This issue has nothing to do with YangInstanceIdentifier nor organization of anything in yangtools. This concerns only the design of InstanceIdentifier, as defined in binding – SchemaContext provides all information required to make it work. Please do not hijack issues to completely unrelated issues. |
| Comment by Jie Han [ 15/Feb/18 ] |
|
Not at all I thought, the Instance Idendifier does not need to represent Choice/Case, it's nothing to do with binding, as in description I got that why the issue created is totally because there are name collision, the immediate idea of reporter to resolve that is to reference choice/case, but that's not the root cause. |
| Comment by Jie Han [ 02/Mar/18 ] |
|
What should the binding instance identifier of choice/case's descendant data nodes finally be?
module test {
...
container top {
choice top-choice {
case case1 {
container cont-in-case1 {
}
choice case1-choice {
case case11 {
container cont-in-case11 {
}
}
}
}
}
}
module aug-test {
...
augment "/test:top/top-choice/case1" {
choice aug-case1-choice {
case case12 {
container cont-in-case12 {
}
}
}
}
}
1.II for 'cont-in-case1' could be: 2.II for 'cont-in-case11' could be: 3.II for 'cont-in-case12' could be: Since choice and case are not data tree nodes, so I prefer to choose option A). |
| Comment by Jie Han [ 07/Mar/18 ] |
|
Instance identifier should not reference choice/case. |
| Comment by Robert Varga [ 23/May/18 ] |
|
Based on the analysis done in |
| Comment by Jie Han [ 13/Sep/18 ] |