This means that the actual value is 123 - the quote characters are not part of the value.[quote=“lukai, post:1, topic:1619”]
typedef foo-type {
type union {
type string;
type int32;
}
default 444;
}
From YANG grammar, I couldn’t tell what’s the actual type of default value “444”, it can be string, it also can be integer.
[/quote]
When a string representing a union data type is validated, the string
is validated against each member type, in the order they are
specified in the "type" statement, until a match is found.
Thus with that type definition, a default value will only ever match the string member, never int32. The corresponding text in RFC 7950 - The YANG 1.1 Data Modeling Language is a little different, because it takes into consideration that in the JSON encoding, strings and integers have different representation, and it is thus possible for a value to match the int32 member, while for XML encoding, a value can only match the string member.