-
Notifications
You must be signed in to change notification settings - Fork 42
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
Support Number jsons #219
Comments
Hi @BraisGabin as far as I am aware it's not possible to encode it that way without precision loss, and the limitation is on the KotlinX serialization side. You can see the issue regarding this here Kotlin/kotlinx.serialization#1051 I'm closing this issue as there is nothing to on our side at the moment. |
Thanks for the fast replay! It seems that they are tracking this "feature" here: Kotlin/kotlinx.serialization#1405 |
Good to know, thanks! |
Hi, just a quick heads up that I'm working on supporting BigDecimal/BigInteger in this PR Kotlin/kotlinx.serialization#2041. I'm a contributor to KxS, not a maintainer, so I can't give any timescale, but hopefully it's soon 🤞 I'd like to be able to help implement support in in this library when it's available! As a preview, you can see the test I wrote for BigDecimal - I expect a serializer for BigNum will be similar https://github.com/Kotlin/kotlinx.serialization/pull/2041/files#diff-46d155dec31ebfaed1e644398258f05f18332f9af8454854f863c0100019eb41 |
humanReadableSerializerModule
should allow to parase things like:But right now it forces to use
"12.34"
. We shouldn't lose any precision by using a number of json. We shouldn't lose any precision by using12.34
.From backend I'm receiving that and with
Moshi
I hadn't any problem. On moshi I read12.34
as aString
(even it is a number in the json) and I parse it toBigDecimal
.The text was updated successfully, but these errors were encountered: