-
Notifications
You must be signed in to change notification settings - Fork 970
Description
Provide DDB Document API method parity by including toJSON() and fromJSON() methods.
See #36 comments from @millems suggesting a new feature request be opened.
This capability was a welcomed addition to the V1 Document API because it was a convenient and low-friction way to work with JSON document strings and DDB.
Adding a notional V1 to V2 DDB Document API migration example that uses both methods.
-- From v1 --
AmazonDynamoDB dynamoDB = AmazonDynamoDBClientBuilder
...
DynamoDB dynamo = new DynamoDB(dynamoDB);
dbtable = dynamo.getTable(table);dbtable.putItem(Item.fromJSON(jsonString));
Item item = dbtable.getItem(spec);
String jsonString = item.toJSON();
-- To v2 --
DynamoDbClient ddbClient = DynamoDbClient
.builder()
...
.build();??? ddbClient.putItem(Item.fromJSON(jsonString))
??? jsonString = ddbClient.getItem(spec).toJSON()