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
Inside CustomClassMapper in method deserializeToClass(Object obj, Class<T> clazz), the conditional statement wrongly assumes the value is of primitive type if Number.class.isAssignableFrom(clazz).
BigDecimal returns true but is not primitive, and throws an IllegalArgumentException in deserializeToPrimitive(Object obj, Class<T> clazz)
I have pushed PRs to provide better error messages. Unfortunately, this will only marginally improve your experience with BigDecimal/BigInteger. Our backend does not support integer precision for numbers that exceed the 64bit signed range. If you do need to store larger numbers, please use "double" instead.
Activity
hiranya911 commentedon Sep 20, 2017
Thanks for pointing this out @CluEleSsUK. If you can please provide us a pull request to fix this. Otherwise I will take a look in a couple of days.
CluEleSsUK commentedon Sep 20, 2017
ghajba commentedon Oct 7, 2017
A question to this topic: how should a BigDecimal/BigInteger be serialized?
I am currently facing the same issue, and I want to fix it, but I don't just want to hack something together.
schmidt-sebastian commentedon Mar 6, 2019
We are taking a look at this internally as this affects Android as well.
schmidt-sebastian commentedon Mar 14, 2019
I have pushed PRs to provide better error messages. Unfortunately, this will only marginally improve your experience with BigDecimal/BigInteger. Our backend does not support integer precision for numbers that exceed the 64bit signed range. If you do need to store larger numbers, please use "double" instead.
hiranya911 commentedon Mar 14, 2019
@schmidt-sebastian are you going to implement any changes in the Admin SDK code?
schmidt-sebastian commentedon Mar 15, 2019
We are only updating our error messages: googleapis/google-cloud-java#4675.
For now, the best work around is using double or Strings, both of which round-trip well between other clients and the backend.
hiranya911 commentedon Oct 8, 2019
As of now we don't plan to support serialization of these types in RTDB. But we can revisit this issue if there's more interest.