Skip to content

Optional Fields #219

@NoxMortem

Description

@NoxMortem

Is it possible to deserialize optional fields?

{
"A": "A",
"@B": "B",
"@C": "C",
"@D": "D",
"@E": "E",
"@F": "F"
}
{
"A": "A",
"@B": "B",
"@C": "C",
"@D": "D",
"@F": "F"
}
[MessagePackObject]
public struct Foo
{
[Key("A")]      public string A;
[Key("@B")]	public string B;
[Key("@C")]	public string C;
[Key("@D")]	public string D;
[Key("@E")]	public string E;
[Key("@F")]	public string F;
}

Is it possible to deserialize both jsons as Foo by having @E as optional field?

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