aws-sdk-go icon indicating copy to clipboard operation
aws-sdk-go copied to clipboard

Add json omitempty tags to dynamodb.AttributeValue fields

Open rittneje opened this issue 4 years ago • 4 comments

I am reopening #3884 because it should not have been closed. The workaround presented by @jasdel does not address the stated problem.

Is your feature request related to a problem? Please describe.

When issuing a DynamoDB query, we can get back a LastEvaluatedKey for use when fetching the next page of results. The type of this fields is map[string]*dynamodb.AttributeValue. We would like to send it back to our API client so they can include it in their next request to us. A convenient way to do this is to json marshal and base 64 encode it. However, since *dynamodb.AttributeValue is missing json:",omitempty" tags on all of its fields, the resulting JSON is way larger than it needs to be.

Describe the solution you'd like

I'd like json:",omitempty" to be added to all of the fields of dynamodb.AttributeValue.

Describe alternatives you've considered

We considered making our own struct that is a copy of dynamodb.AttributeValue, but (1) we don't want to have to manually maintain it, and (2) we would have to make a second map and copy all the entries over for this to work.

rittneje avatar Jun 06 '21 21:06 rittneje

ping @jasdel @KaibaLopez

rittneje avatar Sep 22 '21 05:09 rittneje

Hi all, I have discussed with the team, and we are planning to implement this. However, there is no timeline for this yet, I will comment if we have any update. This feature-request is related to #134 in Go v2 also.

vudh1 avatar Apr 22 '22 17:04 vudh1

We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.

github-actions[bot] avatar Apr 23 '23 00:04 github-actions[bot]

don't close

rittneje avatar Apr 23 '23 00:04 rittneje

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Apr 01 '24 21:04 github-actions[bot]