Enum DefaultValueHandling
Specifies how fields and properties whose current value equals the type's default
value (e.g., 0 for numeric types, false for booleans, null for
reference types) are treated during serialization.
Namespace: Scylla.Core.Util.Serialization
Assembly: ScyllaCore.dll
Syntax
public enum DefaultValueHandling
Remarks
Configured via WithDefaultValueHandling(DefaultValueHandling). Ignoring default values can significantly reduce output size for objects with many fields, but introduces a version-compatibility risk: if a field's default changes between versions of an application, previously-serialized data that omitted the field will deserialize with the new default rather than the original one.
Fields
| Name | Description |
|---|---|
| Ignore | Fields and properties whose value equals the type's default are omitted from the serialized output, reducing payload size. Use this mode when output compactness is a priority and the application can tolerate that omitted fields are reconstructed from whatever default the type declares at deserialization time. |
| Include | Fields and properties whose value equals the type's default are written to the serialized output. This guarantees that deserialization always produces a value identical to the original, regardless of how defaults may change in future versions of the type. |