You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#292 would fix the case for straight-up empty-type leaves. But it doesn't address unmarshalling a union leaf that contains an empty type.
Is this unlikely to occur in practice?
I'd prefer to only solve this for the simple union case to avoid unnecessary work.
When solving this for the simple union case, an easy way would be to generate the following for the To_XXX methods, would this be acceptable, since it prevents having both YANGEmpty and bool within the same union type?:
You could argue that the former is not necessary, but it really helps simplify the unmarshalling code, as otherwise it would require lots of generated code analogous to ΛEnumTypeMap in order to create the YANGEmpty type from the correct package when unmarshalling from either JSON or TypedValue.
The text was updated successfully, but these errors were encountered:
My personal take is that this doesn't need to be part of the v1 milestone since it doesn't introduce any backwards incompatibility issues, and is likely a corner case not usually encountered.
This issue is only relevant when unmarshalling JSON. When unmarshalling a TypedValue, YANGEmpty and bool are indistinguishable from one another in their encoding.
#292 would fix the case for straight-up empty-type leaves. But it doesn't address unmarshalling a union leaf that contains an empty type.
To_XXX
methods, would this be acceptable, since it prevents having both YANGEmpty and bool within the same union type?:in addition to the obvious
You could argue that the former is not necessary, but it really helps simplify the unmarshalling code, as otherwise it would require lots of generated code analogous to
ΛEnumTypeMap
in order to create theYANGEmpty
type from the correct package when unmarshalling from either JSON orTypedValue
.The text was updated successfully, but these errors were encountered: