Closed GoogleCodeExporter closed 9 years ago
Treating empty as null will change the semantics of Java, so there needs to be
a much better rationale for doing
this. In the interim, you can do this by registering a custom serializer for
your collections that treats empty as
null. I will still advise against doing so though.
Original comment by inder123
on 16 Apr 2010 at 6:17
hi! We do not want to change semantic of java or more general of the set
theory. Yet we all used to live with those issues.
I also miss exactly this GSON feature: to treat empty collection as nulls (and
optionally omitting in the serialization like already possible). Please let
this decision be taken by the developer, if he wants empty fields not to be
serialized.
an API on the GsonBuilder would be fine for the first time and maybe, extended
by annotations in the future.
thanks
Original comment by eplisc...@gmail.com
on 2 Apr 2013 at 2:03
Original issue reported on code.google.com by
benjamin...@gmail.com
on 15 Apr 2010 at 2:44