Skip to content

flatten does't respect the rpm_serde::to_vec naming removal #3026

@danielmeza

Description

@danielmeza

Whe using MessagePack with flatten struct and the pm_serde::to_vec the serializer produce properties names for flatten structs.

It should not produce these names since pm_serde::to_vec is supposed to generate array separated properties (by position)

#[derive(Serializer)]
pub struct BaseStruct
{
    pub a: int;
    pub b: int;
}

#[derive(Serializer)]
pub struct RootStruct
{
   #[serde(flatten)]
   pub base: BaseStruct;
   pub c: int;
}

Current MessagePack binary => JSON output

[
  "base": {
    "a": 1, 
    "b": 2
  },
  3
]

Expected output:

[1,2,3]

Based on this issue its a flatten limitation that needs attention:

3Hren/msgpack-rust#296

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