Skip to content

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

@cowtowncoder

Description

@cowtowncoder

(note: follow-up for FasterXML/jackson-dataformat-smile#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions