Skip to content

Serialization of flatten type not supported #20

Closed
@whalelephant

Description

@whalelephant

Reference to: CosmWasm/cw-plus#57

The #[serde(flatten)] serializes with serialize_struct_as_map, however, this lib does not fully implement the SerializeMap function.

This issue can be replicated when one uses cosmwasm_std::to_vec() on a struct with the flatten attribute

12: <&mut serde_json_wasm::ser::Serializer as serde::ser::Serializer>::serialize_map
             at /.../serde-json-wasm-0.2.1/src/ser/mod.rs:376
  13: cw20::query::_::<impl serde::ser::Serialize for cw20::query::AllowanceInfo>::serialize
             at packages/cw20/src/query.rs:71
  14: serde_json_wasm::ser::to_vec
             at /.../serde-json-wasm-0.2.1/src/ser/mod.rs:422
  15: cosmwasm_std::serde::to_vec
             at /.../cosmwasm-std-0.10.1/src/serde.rs:23

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions