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
JSON interoperability issue #5478
Comments
Such long ints could be detected while parsing by the JSON coded and then encoded on the Red side using specific syntax. Maybe @rebolek can confirm the feasibility. It's unlikely we will implement 64-bit integer separately, as it would require many deep changes in the current toolchain. You'll need to wait for the new toolchain in Red. |
Parsing is not as big problem as encoding, because the codec needs to tell the value apart from the string, meaning we would have to pass it as an issue or ref or smth, which would be a weird kludge. |
Could it be encoded as a |
Possibly. Currently it just forms binary in a json string:
|
Money also becomes a string. Percents become a float. |
1-2. Like said above, by RFC you can have infinite precision numbers in JSON and it will be compliant.
|
Describe the bug
I've encountered some API which sends int64 values in and out unquoted in JSON.
Current JSON codec is incapable of encoding or decoding that data. It reads these values as floats:
and encoded JSON payload as float or as string is rejected by the server.
The library that does that is standard in Go, so will affect all programs unless they intentionally bother with 32-bit compatibility. RFC does not enforce any restrictions on number digits.
To reproduce
Expected behavior
We need a 64 bit integer type, or a set of kludges to pass such values around.
Platform version
Red 0.6.4 for Windows built 4-Feb-2024/4:57:33+03:00 commit #9b8169f
The text was updated successfully, but these errors were encountered: