timkendall / crynamo

DynamoDB client for Crystal.
https://timkendall.github.io/crynamo/
MIT License
14 stars 4 forks source link

Make marshaling logic recursive #20

Open timkendall opened 6 years ago

timkendall commented 6 years ago

For Crystal types of arrays and hashes we will need to make Crynamo::Marshaller recursive. For example, here is a DynamoDB query that includes DynamoDB types of M, L, and NS:

 {
    "TableName": "Pets",
    "Item": {
        "Name": {
            "S": "Thor"
        },
        "Lifespan": {
            "N": 100
        },
        "family_friendly": {
            "BOOL": false
        },
        "stuff": {
            "M": {
                "a":{ "N": 1 }
            }
        },
        "list": {
            "L":[{"S": "foo"}, {"BOOL": true}, {"N": 34.55}]
        },
        "number_set": {
            "NS": [1,2,3,4, 5.0]
        }
    }
}