-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deserializing BigDecimal throws exception #75
Comments
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. |
Sure thing, I'll have a look tomorrow!
…On Wed, 20 Sep 2017, 21:47 Hiranya Jayathilaka ***@***.***> wrote:
Thanks for pointing this out @CluEleSsUK <https://github.com/cluelessuk>.
If you can please provide us a pull request to fix this. Otherwise I will
take a look in a couple of days.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#75 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADk4RAQuHn-VUMeZoMjqMmiCy4FRBcC9ks5skXnfgaJpZM4Pd39C>
.
|
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. |
We are taking a look at this internally as this affects Android as well. |
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. |
@schmidt-sebastian are you going to implement any changes in the Admin SDK code? |
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. |
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. |
Inside
CustomClassMapper
in methoddeserializeToClass(Object obj, Class<T> clazz)
, the conditional statement wrongly assumes the value is of primitive type ifNumber.class.isAssignableFrom(clazz)
.BigDecimal returns true but is not primitive, and throws an
IllegalArgumentException
indeserializeToPrimitive(Object obj, Class<T> clazz)
The text was updated successfully, but these errors were encountered: