Skip to content

IgnoreDefaults option has no effect on value types #69

@guyilin-amazon

Description

@guyilin-amazon

The IgnoreDefaults option will only ignore fields and properties that has reference types which defaults to null value. The option has no effect on value types like int, float, bool etc.

Example class:

public class IgnoreDefaultsClass
{
    public int A { get; set; }
    public float B { get; set; }
    public bool C { get; set; }
}

serialize object new IgnoreDefaultsClass() will produce following Ion when IgnoreDefaults is set to true:

{
  a: 0,
  b: 'numeric.float32'::0e0,
  c: false
}

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