-
Notifications
You must be signed in to change notification settings - Fork 142
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
Can JSON decoder be loose on constraints about float? #364
Labels
Kind:Needs More Info
Needs more information to investigate.
Comments
whatyouhide
changed the title
Can json decoder be loose on constraints about float ?
Can JSON decoder be loose on constraints about float?
Nov 30, 2023
@junaid1460 thanks for the report! Do you know what other Protobuf libraries (for other languages) do in these cases? |
whatyouhide
added
the
Kind:Needs More Info
Needs more information to investigate.
label
May 11, 2024
We've been using protobuf in dart/flutter its json decoder just automatically handles 1 and spits out 1.0. eg: // 1
{"value": 1}
// 2
{"value": 2.3} message Resp {
float value;
} when we parse |
Gotcha, what do decoders for Ruby and Python do for example? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Most JSON encoders just wrap 1.0 to 1, while protobuf gives good enough code generation, can we cast 1 -> 1.0 for floats and doubles?
The alternate solution is to use FloatValue and DoubleValue, that feels like just more work for no reason
The text was updated successfully, but these errors were encountered: