-
Notifications
You must be signed in to change notification settings - Fork 669
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
encoder.encodeMap() should not encodeNull() when map length is zero #195
Comments
Hello @wizardishungry, thank you for reaching out to us. We've received this same issue in v1, please see here. The workaround will also work for v2. I am going to go ahead and mark this as a feature request. If you have any more questions or issues with the workaround please let us know. |
For those arriving via search, etc. – a workaround for v2: av, err := dynamodbattribute.MarshalMap(message)
if err != nil {
return nil, err
}
emptyMap := make(map[string]dynamodb.AttributeValue)
av["some map"] = dynamodb.AttributeValue{M: emptyMap} |
…s empty map Adds support for marshaling nil maps and slices as empty maps and lists instead of NULL DynamoDB AttributeValue. Fix aws#682 Related: aws/aws-sdk-go-v2#195 Original PR: aws#2105
This is related to the v1 SDK work, aws/aws-sdk-go#2419 |
This feature was implemented in #401 and released in v0.13.0 |
Version of AWS SDK for Go?
2.0.0-preview.4
Version of Go (
go version
)?go version go1.10.3 darwin/amd64
What issue did you see?
My Dynamo records are being created with NULL entries instead of empty maps.
Steps to reproduce
aws-sdk-go-v2/service/dynamodb/dynamodbattribute/encode.go
Lines 335 to 360 in ac26486
The text was updated successfully, but these errors were encountered: