val instead of object for BigInt and BigDecimal #44

fommil opened this Issue Feb 6, 2013 · 0 comments


None yet
3 participants

fommil commented Feb 6, 2013

I would like to use a custom marshaller for BigInt and BigDecimal, to use JsString instead of JsNumber.

The reason for this is because we are re-using Spray JSON marshallers to serialise to/from MongoDB objects. Despite claims that BSON is a superset of JSON, it doesn't support arbitrary precision numbers. i.e. there is no such thing as BsonNumber – it's all ints or longs, floats or doubles. The workaround is that any arbitrary precision numbers must be serialised as String in MongoDB.

Unfortunately, because the implicit JsonFormats are defined as implicit object, the scala compiler will not let me override them. If they were implicit val, I believe this would be ok.

@fommil fommil referenced this issue in eigengo/scalad Mar 20, 2013


deprecate StringBigX #67

@jrudolph jrudolph added this to the Next bugfix release milestone Mar 7, 2014

@jrudolph jrudolph added the Improvement label Mar 7, 2014

@ktoso ktoso modified the milestones: Next bugfix release, Next next Oct 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment