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

Don't skip anonymous (embedded) fields with named tags #2022

Merged
merged 1 commit into from
Feb 20, 2023

Conversation

Airblader
Copy link
Contributor

@Airblader Airblader commented Feb 14, 2023

When collecting the fields in a struct, we skip over embedded fields because by default they are just that: embedded.

However, if the embedded field itself carries a named tag, it is not embedded during serialization, so consider this case.

fixes #2021

I'm happy to make this configurable if necessary, but the new behavior is how the standard json / yaml packages work, too, and I do believe it would be the intended behavior.

When collecting the fields in a struct, we skip over embedded fields
because by default they are just that: embedded.

However, if the embedded field itself carries a named tag, it is
not embedded during serialization, so consider this case.

fixes aws#2021
@Airblader Airblader requested a review from a team as a code owner February 14, 2023 17:18
@aajtodd aajtodd merged commit 9af2842 into aws:main Feb 20, 2023
@Airblader Airblader deleted the issue-2021 branch February 20, 2023 12:43
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.

DynamoDb marshaler ignores a name tag for embeded structs
2 participants