1
votes

I've been following Miguel C's tutorial on setting up a DynamoDB table in golang but modified my json to look like this instead of using movies. I modified the movie struct into a Fruit struct (so there is no more info) and in my schema I defined the partition key as "Name" and the Sort Key as "Price". But when I run my code it says

"ValidationException: One of the required keys was not given a value"

despite me printing out the input as

map[name:{ S: "bananas" } price:{ N: "0.25" }]

which clearly shows that String bananas and Number 0.25 both have values in them.

My Json below looks like this:

[
  {
    "name": "bananas",
    "price": 0.25
  },
  {
    "name": "apples",
    "price": 0.50
  }
]
1
what if you use Name instead of name? - kkesley
That was the issue. I thought I didn't have to worry about capitalization since it's just getting the json into golang as a Fruit struct but put was looking at the "name" and "price" as keys, which ofc didn't exist. Thanks - Igeneous

1 Answers

0
votes

Capitalization issue, changed "name" to "Name" and it worked out.