Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Add custom Marshal/Unmarshal to support empty lists #400

Merged
merged 3 commits into from
Apr 24, 2018
Merged

Conversation

jcoyne
Copy link
Contributor

@jcoyne jcoyne commented Apr 12, 2018

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

Copy link
Contributor

@cmharlow cmharlow left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe this addresses the issues in #395 per @jcoyne's previous comments and review here. Can @jcoyne confirm?

@@ -36,7 +36,7 @@
"structural": {
"hasAgreement": "druid:dd327qr3670",
"hasMember": [],
"isTargetOf": "",
"isTargetOf": null,
Copy link
Contributor

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

@aaron-collier
Copy link
Contributor

Happy to approve this once it's green. Tests run fine locally... so assuming it may be a container thing?

@jcoyne jcoyne force-pushed the roundTrip branch 3 times, most recently from 60ff93d to 2bf0504 Compare April 24, 2018 03:45
jcoyne added 3 commits April 23, 2018 22:50
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
@eefahy eefahy merged commit 8aec7b8 into master Apr 24, 2018
@eefahy eefahy deleted the roundTrip branch April 24, 2018 16:43
@eefahy eefahy removed the review label Apr 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants