Skip to content

Yaml deserialization of embedded orderedmap: extra fields from parent #36

@Antiarchitect

Description

@Antiarchitect

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions