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
When I use MessageToJson function serializing "int64 n" to JSON, the value of n is 40, it should output like {"n":40 }, but the fact is output like {"n":"40"}, how to fix it ??
The text was updated successfully, but these errors were encountered:
This may be a bandaid fix due to a limitation in JavaScript, i.e. it doesn't have support for 64 bit integers, only doubles. Perhaps preserving the original value as a string allows the module to decode it correctly.
JSON implementations may not support 64-bit integers so to guarantee the value can be round-tripped we print 64-bit integers as strings. If you are consuming the proto JSON output directly, make sure you are doing it in accordance with the proto3 JSON mapping here:
When I use MessageToJson function serializing "int64 n" to JSON, the value of n is 40, it should output like {"n":40 }, but the fact is output like {"n":"40"}, how to fix it ??
The text was updated successfully, but these errors were encountered: