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

val instead of object for BigInt and BigDecimal #44

Closed
fommil opened this issue Feb 6, 2013 · 0 comments
Closed

val instead of object for BigInt and BigDecimal #44

fommil opened this issue Feb 6, 2013 · 0 comments

Comments

@fommil
Copy link
Contributor

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.

@jrudolph jrudolph added this to the Next bugfix release milestone Mar 7, 2014
@ktoso ktoso modified the milestones: Next bugfix release, Next next Oct 24, 2017
@fommil fommil closed this as completed Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants