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

Unable to round trip data #387

Closed
jcoyne opened this issue Apr 9, 2018 · 0 comments
Closed

Unable to round trip data #387

jcoyne opened this issue Apr 9, 2018 · 0 comments
Assignees

Comments

@jcoyne
Copy link
Contributor

jcoyne commented Apr 9, 2018

When you do a GET request for a resource and it has an empty array for a field such as structural.hasMembers, TACO returns a null value. This is not a valid value as it's supposed to be an empty array.

I believe this is caused by dynamodbattribute.MarshalMap (used in db/insert.go). See aws/aws-sdk-go-v2#115

$ curl -H "On-Behalf-Of: lmcrae@stanford.edu" http://localhost:8080/v1/resource/477713c0-c287-4774-9db0-ffaa1e978314|json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1440  100  1440    0     0  92006      0 --:--:-- --:--:-- --:--:-- 96000
{
   "tacoIdentifier" : "477713c0-c287-4774-9db0-ffaa1e978314",
   "access" : {
      "access" : "world",
      "copyright" : "This work is copyrighted by the creator.",
      "reuseAndReproductionStatement" : "Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Special Collections Public Services Librarian at speccollref@stanford.edu.",
      "download" : "world"
   },
   "label" : "UPDATED: Leon Kolb Collection of Portraits",
   "administrative" : {
      "created" : "2011-07-05T17:12:18.779Z",
      "remediatedBy" : [
         {
            "sunetID" : "lauraw15",
            "name" : "Laura Wilsey"
         }
      ],
      "isDescribedBy" : "https://purl.stanford.edu/bs646cd8717.xml",
      "deleted" : false,
      "lastUpdated" : "2016-11-04T18:21:45.889Z",
      "sdrPreserve" : true
   },
   "identification" : {
      "sourceId" : "bib4084372",
      "sdrUUID" : "742a0134-1e20-11e2-979d-022c4a946c80",
      "identifier" : "druid:bs646cd8717",
      "catkey" : "4084372"
   },
   "@type" : "http://sdr.sul.stanford.edu/models/sdr3-collection.jsonld",
   "depositor" : {
      "sunetID" : "DOR",
      "name" : "DOR"
   },
   "citation" : "Leon Kolb Collection of Portraits. https://purl.stanford.edu/bs646cd8717",
   "version" : 1,
   "@context" : "http://sdr.sul.stanford.edu/contexts/taco-base.jsonld",
   "structural" : {
      "isTargetOf" : null,
      "hasMember" : null,
      "hasMemberOrders" : null,
      "hasAgreement" : "druid:dd327qr3670"
   },
   "$comment" : "This is a fixture used for testing. It was derived from create-bs646cd8717.json",
   "externalIdentifier" : "477713c0-c287-4774-9db0-ffaa1e978314"
}
jcoyne added a commit that referenced this issue 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
jcoyne added a commit that referenced this issue 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
jcoyne added a commit that referenced this issue 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
@jcoyne jcoyne added review and removed in progress labels Apr 12, 2018
jcoyne added a commit that referenced this issue 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
jcoyne added a commit that referenced this issue Apr 23, 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
jcoyne added a commit that referenced this issue Apr 24, 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
jcoyne added a commit that referenced this issue Apr 24, 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
eefahy pushed a commit that referenced this issue Apr 24, 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
@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

No branches or pull requests

2 participants