You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
JsonFormat
s are defined asimplicit object
, the scala compiler will not let me override them. If they wereimplicit val
, I believe this would be ok.The text was updated successfully, but these errors were encountered: