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

dynamodbattribute.Marshal incorrectly marshals an empty list to {NULL: true} #2746

Closed
vipingoel opened this issue Aug 9, 2019 · 1 comment · Fixed by #2858
Closed

dynamodbattribute.Marshal incorrectly marshals an empty list to {NULL: true} #2746

vipingoel opened this issue Aug 9, 2019 · 1 comment · Fixed by #2858
Labels
bug This issue is a bug.

Comments

@vipingoel
Copy link

Please fill out the sections below to help us address your issue.

Version of AWS SDK for Go?

v1.21.5

Version of Go (go version)?

go version go1.11.5 linux/amd64

What issue did you see?

dynamodbattribute.Marshal incorrectly marshals an empty list to {NULL: true}

Steps to reproduce

func Test_marshalIssue(t *testing.T) {
	type customStruct struct {
		key string
		val string
	}

	d, _ := dynamodbattribute.Marshal([]*customStruct{})
	t.Error(d)
	/*prints
		 {
	        NULL: true
		 }
	*/
}

Expected:
Empty list should be marshaled to

&dynamodb.AttributeValue{
    L: []*dynamodb.AttributeValue{},
}
@diehlaws diehlaws self-assigned this Aug 16, 2019
@diehlaws diehlaws added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Aug 16, 2019
@diehlaws diehlaws added bug This issue is a bug. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Aug 29, 2019
@diehlaws
Copy link
Contributor

Hi @vipingoel, thanks for reaching out to us about this and I do apologize for the long delay in response from our end. Fixing this behavior is something we've had in our backlog for some time, I've brought this up with the rest of the team this week and we've agreed to prioritize the implementation of this change in a non-breaking manner. You can track progress on this in PR #2419.

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

Successfully merging a pull request may close this issue.

2 participants