UnmarshalYaml does not support to decode struct without calling it recursively.
Problem is described here:
https://stackoverflow.com/questions/60636689/custom-unmarshalyaml-interface-for-an-interface-and-its-implementations
Usecase:
- Add additional validation when node object is already converted to struct.
- Allow to parse and fill struct with multiple of the child properties when most is default yaml interface.
- Setting some properties on the final struct when umarshaling is completed.
Decode should not call UnmarshalYaml recursively.
old interface was supporting all those features because unmarshal is not calling UnmarshalYAML
func (m *MyStruct) UnmarshalYAML(unmarshal func(interface{}) error) error {