Details
-
Bug
-
Status: Resolved
-
Resolution: Done
-
Oxygen, Nitrogen SR1, Carbon SR2
-
None
-
Operating System: All
Platform: All
-
5826
Description
If you use a leaf from grouping of type union as a key in list, binding generates key class without that leaf as part of key.
grouping common-cars {
leaf brand {
type union {
type uint64;
type string;
}
}
leaf engine { type string; }
leaf gearbox { type string; }
}
container cars {
list car {
key "brand";
uses common-cars;
}
}
From this yang we get empty key binding class
public class CarKey implements Identifier<Car> { private static final long serialVersionUID = -7229666078144872030L; public CarKey() { } }
Simple workaround is to not use grouping. You can also define your own type with the appropriate union type as the base type and use this new type as a type for leaf in grouping.
Attachments
Issue Links
- is blocked by
-
MDSAL-237 Milestone: Implement Binding Specification - Java v2
- Resolved
| # | Subject | Branch | Project | Status | CR | V |
|---|---|---|---|---|---|---|
| 67826,3 | Lookup leaf key methods in parents | master | mdsal | Status: MERGED | +2 | +1 |
| 67917,3 | Lookup leaf key methods in parents | stable/nitrogen | mdsal | Status: MERGED | +2 | +1 |
| 67918,4 | Lookup leaf key methods in parents | stable/carbon | mdsal | Status: MERGED | +2 | +1 |