I’m trying to update a table in my DynamoDB tables using the PHP SDK. Here’s the error:
com.amazon.coral.service#SerializationException
Start of list found where not expected
I’m guessing there is something wrong with the formatting of my array. I’m using this documentation for reference.
The Array I’m sending:
array(3) {
["TableName"]=>
string(7) "teacher"
["Key"]=>
array(1) {
["HashKeyElement"]=>
array(1) {
["S"]=>
string(36) "97770A6A-EF06-AF4A-3E30-87DAC0237F6D"
}
}
["AttributeUpdates"]=>
array(1) {
[0]=>
array(2) {
["population"]=>
array(1) {
["Action"]=>
string(3) "ADD"
}
["Value"]=>
array(1) {
["SS"]=>
array(1) {
[0]=>
string(36) "97770A6A-EF06-AF4A-3E30-87DAC0237F6D"
}
}
}
}
}
The “population” in AttributeUpdates is incorrectly placed in the array. It should be a key to the element and not the element itself. The “Value” and “Action” are both part of the array element: The structure should be:
The source: