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

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants