-
Notifications
You must be signed in to change notification settings - Fork 12
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
Wouldn't String be a better serialization format for BigInteger and BigDecimal? #7
Comments
Yes that's right. I am not 100% satisfied with the current solution. At the time of the initial implementation I was guided by Jackson, which also serialize BigInteger and BigDecimal as numbers. On the one hand, this is not really a big deal because you can just register a custom VPackSerializer when you need to serialize them as String, on the other hand we might want to offer a more convenient way to change the serialized type for BigInteger and BigDecimal. A quick search on google shows what possibilities you have with Jackson.
I am open to suggestions. Should we change the default to String or just document how the default behavior is and how to easily change it with a custom VPackSerializer. What we can do in any case is to make the deserializer for BigInteger and BigDecimal compatible with both number and String. best |
That's not an easy question. But considering that the reason why
I totally agree with that. |
My first point against this change was that you can't work properly in AQL with this anymore, but then I realized that you can type cast it in AQL with So I think, from the point of avoiding data loss, we should serialize it as With the change on the deserializers I also see no real pain point with backward compatibility. |
fixen in 1.1.0 |
Hi!
I saw that
BigInteger
is serialized aslong
andBigDecimal
asdouble
. But they can easily overflowlong
anddouble
(that's why they exist ;)). Wouldn't it be better to serialize both asString
?Greetings,
Christian
The text was updated successfully, but these errors were encountered: