Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

allow decoding nested struct ptrs to map #271

Merged

Conversation

vlanse
Copy link
Contributor

@vlanse vlanse commented Jan 21, 2022

This will address #267 (see added tests for example)

I've seen #231, and paid special attention that existing tests will not be broken. BTW, for me fixing #231 broken desired behaviour, but I understand the needs and importance of compatibility :)

My case is rather simple:
I have a struct with another embedded struct that also contains pointers to another structs along with "basic" type values. Before the fix, those embedded structs were not decoded into maps (i.e. map[string]interface{}) although they had mapstructure tags set appropriately. Added test could serve as a simplified example for described situation.

@vlanse vlanse force-pushed the fix/decode-nested-pointer-structs-to-map branch from 2a4f429 to 94c41ea Compare January 21, 2022 13:17
@marcecaro
Copy link

Hello, Any news on merging this PR? This fix is much needed. Thanks

@mitchellh
Copy link
Owner

This looks great. Thank you!

@mitchellh mitchellh merged commit 2328018 into mitchellh:master Apr 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants