-
Improvement
-
Resolution: Done
-
Low
-
None
-
None
Yang allows adding multiple identityrefs as possible types in an Union. For example:
identity compliance-code-identity { description "Base identity for reporting pluggable compliance codes per port."; } identity network-phy-code-identity { description "base identity for network phy code."; } identity client-phy-code-identity { description "base identity for client phy code."; } type union { type identityref { base compliance-code-identity; } type identityref { base client-phy-code-identity; } type identityref { base network-phy-code-identity; } type uint64; type decimal64 { fraction-digits 8; } }
However when MDSAL generates binding class for this union, it only contains the first Identityref specified. In this case the compliance-code-identity.
Binding generator processes the "identityref" as an ordinary "type" and therefore it ignores multiple occurencies of it, just as it does for any other type. But Identityref isn't an ordinary type, so it should be processed differently.
The result is as follows:
public class ComplianceCodesUnion implements TypeObject, Serializable { private static final long serialVersionUID = -3780142905034216089L; private final Class<? extends ComplianceCodeIdentity> _identityref; private final BigInteger _uint64; private final BigDecimal _decimal64;
Modify the binding generator to include all the identityrefs.
- is blocked by
-
MDSAL-733 Change 'type identityref' Binding representation to normal objects
- Resolved