This repository has been archived by the owner on Mar 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Add custom Marshal/Unmarshal to support empty lists #400
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmharlow
reviewed
Apr 23, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes from group call: reasons for 400
- when you do an Update on a resource's metadata, we need to allow setting a field to null because that's a way to do an overwrite of an existing field
- some fields need empty arrays, others need empty strings (which we're okay to use null instead)
|
||
// A Decoder provides unmarshaling AttributeValues to Go value types. | ||
type Decoder struct { | ||
// Instructs the decoder to decode AttributeValue Numbers as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -36,7 +36,7 @@ | |||
"structural": { | |||
"hasAgreement": "druid:dd327qr3670", | |||
"hasMember": [], | |||
"isTargetOf": "", | |||
"isTargetOf": null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reminder to self: document this in metadata guidelines per original discussion + agreement on this practice with jcoyne
Happy to approve this once it's green. Tests run fine locally... so assuming it may be a container thing? |
60ff93d
to
2bf0504
Compare
This makes it possible to round trip our data without loosing empty lists. Note, dynamodb doesn't support empty strings, and these changes do nothing to work around that. Fixes #387 See: aws/aws-sdk-go#682
cmharlow
approved these changes
Apr 24, 2018
aaron-collier
approved these changes
Apr 24, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes it possible to round trip our data without loosing empty
lists. Note, dynamodb doesn't support empty strings, and these changes
do nothing to work around that.
Fixes #387
See: aws/aws-sdk-go#682