Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Antiarchitect opened this issue Sep 6, 2023 · 1 comment

Comments

@Antiarchitect
Copy link

Antiarchitect commented Sep 6, 2023

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

@Antiarchitect Antiarchitect changed the title Yaml deserialization of embedded orderedmap Yaml deserialization of embedded orderedmap: extra fields from parent Sep 6, 2023
@wk8
Copy link
Owner

wk8 commented Sep 6, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants