Skip to content
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

Need to support scala.math.BigDecimal (and BigInt) #149

Closed
cowtowncoder opened this issue May 29, 2014 · 2 comments
Closed

Need to support scala.math.BigDecimal (and BigInt) #149

cowtowncoder opened this issue May 29, 2014 · 2 comments

Comments

@cowtowncoder
Copy link
Member

(note: follow-up for https://github.com/FasterXML/jackson-dataformat-smile/issues/16)


Since Scala has its own variants of JDK's BigDecimal and BigInteger, there is need to add explicit serializers/deserializers for these types. Some level of support does exist already when using JSON, since Number values can be serialized by fallback writeNumber(String) method; however, this does not work with all backend, and specifically won't work with binary formats like Smile.

I am guessing that it should be relatively easy to do something like construct Java equivalents for serialization, and then call JsonGenerator.writeNumber(...) method with native type. And on deserialization side, reverse should be possible as well.
Care should be taken to allow coercion from String value, similar to how JDK values are handled. It may be best to basically port over existing BigDecimal/BigInteger handlers to Scala moduler, for Scala types.

@christophercurrie
Copy link
Member

Sure, I can make this happen for 2.4.

@cowtowncoder
Copy link
Member Author

That'd be great. And even if it didn't make it in 2.4.0, it should be easy enough to add as there's no API level changes.

christophercurrie added a commit that referenced this issue Nov 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants