go-ordered-map
go-ordered-map copied to clipboard
Yaml deserialization of embedded orderedmap: extra fields from parent
Using 2.1.8
Having this struct:
type A struct {
Defaults string `yaml:"defaults"`
Others orderedmap.OrderedMap[string, string] `yaml:",inline"`
}
and this YAML:
defaults: "some defaults"
a: "a"
b: "b"
Expecting to get Others
with only a
and b
keys inside, but getting full default
, a
, b
set of keys:
https://go.dev/play/p/RTww5Itk3g4
Standard Go map works as I expect: https://go.dev/play/p/_HkazAAFx-z
Definitely a bug, thanks for the report :)
Will try to have a look at it when I have time, but in the meantime PRs are always welcome!