Closed whalelephant closed 1 year ago
Thank you for this issue and your research on the item. Good find
Not sure if strictly related to this, but I've noticed there's now map ser/de support in the upstream crate (serde-json-core).
I can integrate it if you think it's worth it / would help fix this.
@ethanfrey now it's been a while since the upstream added map support, which means that flatten
can be used (meaning a lot of CW codes can be refactored) — is there any plans to update it?
Map support was just merged to main. In order to close this ticket, I think we should have explicit #[serde(flatten)]
tests that show the input als Rust struct and the expected output as plain JSON.
Reference to: https://github.com/CosmWasm/cosmwasm-plus/issues/57
The
#[serde(flatten)]
serializes withserialize_struct_as_map
, however, this lib does not fully implement theSerializeMap
function.This issue can be replicated when one uses
cosmwasm_std::to_vec()
on a struct with the flatten attribute