Utf8Json icon indicating copy to clipboard operation
Utf8Json copied to clipboard

Exclude default values from serialization

Open tadam75 opened this issue 5 years ago • 1 comments

Hello,

In order to spare bandwidth and to have the same behaviour as Json.NET DefaultValueHandling.Ignore attribute, it would be great to have the possibility to remove default values from serialization.

I've worked on it for the types I'm using (bool, int, double, decimal, enum) in this commit, but I think a general solution would be a nice feature for your library.

tadam75 avatar Mar 28 '19 11:03 tadam75

It's a very handy feature, indeed. Or, alternatively, can you guys provide a method to entirely exclude a property on JsonWriter

andreminelli avatar Dec 13 '20 21:12 andreminelli