Open GoogleCodeExporter opened 9 years ago
Original comment by inder123
on 27 Mar 2009 at 7:36
deferred to a future release
Original comment by inder123
on 29 Sep 2009 at 9:12
It seems that @Required makes only sense in combination with !SerializeNulls.
On the other hand, @Optional would make sense in combination with SerializeNull.
Original comment by philipp....@gmail.com
on 18 Sep 2010 at 8:36
Original comment by inder123
on 1 Nov 2010 at 10:30
Original comment by inder123
on 3 Nov 2010 at 12:27
http://code.google.com/p/google-gson/source/detail?r=1210 provides an
experimental way to achieve this.
Original comment by inder123
on 11 Oct 2012 at 6:51
Are there any current best practices for working around this? With the current
implementation, I never have confidence that my deserialized objects have
proper values and end up having to null-check all of my object's data before
using it.
Suggestions like http://stackoverflow.com/a/14245807/128948 look promising, but
trying to see what the other options are.
Original comment by Matthew....@gmail.com
on 11 Feb 2014 at 10:18
I'm also looking for a way to throw an Exception if a mandatory field is not in
the Json String.
Original comment by dinisnun...@gmail.com
on 28 Aug 2014 at 9:22
Count me as +1. Catching NPE much later in some distant unrelated places is
quite ugly. I have to build my custom workarounds for this, but it would be so
much better to have proper support provided by the lib.
Original comment by cherva...@gmail.com
on 10 Dec 2014 at 12:46
Original issue reported on code.google.com by
inder123
on 17 Oct 2008 at 10:31