You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Over the last few months using spray-json I had learned the following (incorrect) rule:
null is allowed iff your type is of the form Option[X]
Today I unlearned this rule when I converted a null into Double.NaN (#8) instead triggering an exception, which is what I was expecting to happen. Trying out a bunch of standard formats, I observe these behaviors when deserializing from null:
Dan,
thanks for this analysis. You definitely have a point here.
I think we should disallow null for anything but Options.
We'll discuss it on our side and come up with a solution.
Thanks again for taking the time to analyse and report!
Over the last few months using spray-json I had learned the following (incorrect) rule:
Today I unlearned this rule when I converted a
null
intoDouble.NaN
(#8) instead triggering an exception, which is what I was expecting to happen. Trying out a bunch of standard formats, I observe these behaviors when deserializing fromnull
:I think the library's behavior would be less surprising and thus easier to use if the rule above did hold. To that end, I propose:
null
<->Float.NaN
/Double.Nan
, disabled by defaultnull
->()
forUnit
Thoughts? Are there more cases that I'm missing? Is the issue more subtle than this?
The text was updated successfully, but these errors were encountered: