mockersf / serde_dynamodb

Talk with dynamodb using your existing structs thanks to serde

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

expected struct `rusoto_dynamodb::AttributeValue`, found struct `rusoto_dynamodb::generated::AttributeValue`

getmetorajesh opened this issue · comments

commented

looks like the types don't quite match after doing a serde_dynamodb::to_hashmap

sample code,

#[derive(Serialize)]
    struct Basic {
        i: i32,
        f: f32,
    }
    let value = Basic { i: 5, f: 10.2 };
    let putitem = PutItemInput {
        table_name: String::from("test"),
        item: serde_dynamodb::to_hashmap(&value).unwrap(),
        ..Default::default()
    };

Error:

expected struct `rusoto_dynamodb::AttributeValue`, found struct `rusoto_dynamodb::generated::AttributeValue`
commented

turns out the I was using older version(0.1) as said in crates.io whereas 0.2.0 is the latest version. This PR should fix

Thanks !

Hi, I'm seeing something similar now.

If in Cargo.toml I use the most recent version of rusoto:

rusoto_core = "0.42.0"
rusoto_dynamodb = "0.42.0"
serde_dynamodb = "0.4.0"

I get the above error.

Output of cargo tree

Screen Shot 2019-11-28 at 9 35 51 AM

After reverting to an earlier version of rusoto, the error is cleared.

rusoto_core = "0.40.0"
rusoto_dynamodb = "0.40.0"
serde_dynamodb = "0.4.0"

@wbprice just published version 0.4.1 with updated rusoto dependency (0.42)