-
Notifications
You must be signed in to change notification settings - Fork 653
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
dynamodb/attributevalue: Marshal does not support json.Number to Numeric data type #929
Labels
feature-request
A feature should be added or improved.
Comments
jasdel
changed the title
dynamodbattribute.Marshal() does not marshal json.Number to Numeric data type
dynamodb/attributevalue: Marshal does not support json.Number to Numeric data type
Nov 30, 2020
8 tasks
3 tasks
jasdel
added a commit
to jasdel/aws-sdk-go-v2
that referenced
this issue
Dec 9, 2020
Adds support for * Fixes aws#895 - Add support for attribute value marshaling * Fixes aws#929 - Support Number type aliases of string for support for json.Number like types. * Fixes aws#115 - Simplifies the rules of `null` vs skipped vs zero value for all types. * All nil pointers, map, slice members are serialized as NULL. * omitempty struct tag skips zero value of members with the struct tag. * Empty and Nil Sets (NS, BS, SS) are serialized to null by default unless `NullEmptySets` EncoderOptions is set to false. True by default. Nil sets are always serialized as NULL, unless the `omitempty` struct tag is used. * Adds `nullempty` and `nullemptyelem` struct tags to direct if the encoder should marshal the member as a AttributeValue NULL if the member's value is the type's zero value, (e.g. "" for string, 0 for number, nil for pointer/map/slice, false for bool)
jasdel
added a commit
to jasdel/aws-sdk-go-v2
that referenced
this issue
Dec 9, 2020
Adds support for * Fixes aws#895 - Add support for attribute value marshaling * Fixes aws#929 - Support Number type aliases of string for support for json.Number like types. * Fixes aws#115 - Simplifies the rules of `null` vs skipped vs zero value for all types. * All nil pointers, map, slice members are serialized as NULL. * omitempty struct tag skips zero value of members with the struct tag. * Empty and Nil Sets (NS, BS, SS) are serialized to null by default unless `NullEmptySets` EncoderOptions is set to false. True by default. Nil sets are always serialized as NULL, unless the `omitempty` struct tag is used. * Adds `nullempty` and `nullemptyelem` struct tags to direct if the encoder should marshal the member as a AttributeValue NULL if the member's value is the type's zero value, (e.g. "" for string, 0 for number, nil for pointer/map/slice, false for bool)
jasdel
added a commit
to jasdel/aws-sdk-go-v2
that referenced
this issue
Dec 11, 2020
Adds support for * Fixes aws#895 - Add support for attribute value marshaling * Fixes aws#929 - Support Number type aliases of string for support for json.Number like types. * Fixes aws#115 - Simplifies the rules of `null` vs skipped vs zero value for all types. * All nil pointers, map, slice members are serialized as NULL. * omitempty struct tag skips zero value of members with the struct tag. * Empty and Nil Sets (NS, BS, SS) are serialized to null by default unless `NullEmptySets` EncoderOptions is set to false. True by default. Nil sets are always serialized as NULL, unless the `omitempty` struct tag is used. * Adds `nullempty` and `nullemptyelem` struct tags to direct if the encoder should marshal the member as a AttributeValue NULL if the member's value is the type's zero value, (e.g. "" for string, 0 for number, nil for pointer/map/slice, false for bool)
jasdel
added a commit
to jasdel/aws-sdk-go-v2
that referenced
this issue
Dec 14, 2020
Adds support for * Fixes aws#895 - Add support for attribute value marshaling * Fixes aws#929 - Support Number type aliases of string for support for json.Number like types. * Fixes aws#115 - Simplifies the rules of `null` vs skipped vs zero value for all types. * All nil pointers, map, slice members are serialized as NULL. * omitempty struct tag skips zero value of members with the struct tag. * Empty and Nil Sets (NS, BS, SS) are serialized to null by default unless `NullEmptySets` EncoderOptions is set to false. True by default. Nil sets are always serialized as NULL, unless the `omitempty` struct tag is used. * Adds `nullempty` and `nullemptyelem` struct tags to direct if the encoder should marshal the member as a AttributeValue NULL if the member's value is the type's zero value, (e.g. "" for string, 0 for number, nil for pointer/map/slice, false for bool)
jasdel
added a commit
to jasdel/aws-sdk-go-v2
that referenced
this issue
Dec 15, 2020
Adds support for * Fixes aws#895 - Add support for attribute value marshaling * Fixes aws#929 - Support Number type aliases of string for support for json.Number like types. * Fixes aws#115 - Simplifies the rules of `null` vs skipped vs zero value for all types. * All nil pointers, map, slice members are serialized as NULL. * omitempty struct tag skips zero value of members with the struct tag. * Empty and Nil Sets (NS, BS, SS) are serialized to null by default unless `NullEmptySets` EncoderOptions is set to false. True by default. Nil sets are always serialized as NULL, unless the `omitempty` struct tag is used. * Adds `nullempty` and `nullemptyelem` struct tags to direct if the encoder should marshal the member as a AttributeValue NULL if the member's value is the type's zero value, (e.g. "" for string, 0 for number, nil for pointer/map/slice, false for bool)
jasdel
added a commit
that referenced
this issue
Dec 15, 2020
…948) Adds utilities for mapping Amazon DynamoDB API AttributeValue to and from Go types. * Adds conversion util for DynamoDB -> DynamoDBStreams AttributeValue. * Fixes #895 - Adds back marshaler/unmarshalers for attribute value to/from go types. * Fixes #929 - Adds generic support for `json.Number` like types that are aliases of `string`s. * Fixes #115 - Simplifies the rules of `null` vs skipped vs zero value for all types. * All nil pointers, map, slice members are serialized as NULL AttributeValue. * `omitempty` struct tag skips zero value of members with the struct tag. `omitemptyelem` skips elements of list/map that have zero value. * `nullempty` struct tag serializes zero value of members with the struct tag as NULL AttributeValue. `nullemptyelem` does same for elements of list/map that have zero value. * Empty and Nil Sets (NS, BS, SS) are serialized to null by default unless `NullEmptySets` EncoderOptions is set to false. True by default. Nil sets are always serialized as NULL, unless the`omitempty` struct tag is used. * Adds `nullempty` and `nullemptyelem` struct tags to direct if the encoder should marshal the member as a AttributeValue NULL if the member's value is the type's zero value, (e.g. "" for string, 0 for number, nil for pointer/map/slice, false for bool)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
The deprecated
dynamodbattribute.ConvertTo(...)
has broader functionality than the newdynamdbattribute.Marshal(...)
.Describe the solution you'd like
Ideally, the new function should be able to convert json.Number type to the numeric dynamodb data type N or the sdk should have another non-deprecated function for making that conversion.
Additional context
Refer to V1 issue #3643 for code samples and explanation.
The text was updated successfully, but these errors were encountered: