Open lukaskollmer opened 2 years ago
@lukaskollmer, that is the encoding for protos in JSON format: https://developers.google.com/protocol-buffers/docs/proto3#json
64-bit ints are formatted as strings, but accepted as either strings or numbers. The reason is that JS runtimes use a 64-bit floating point representation for numbers, which cannot accurately represent all integers above 2^53.
When making a request to a gRPC method returning a message that contains an integer, the JSON structure printed to stdout wraps these numbers in double quoues.
E.g.:
The same also applies to repeated integers, in which case the output would be e.g.
{ "value": ["1", "2", "3"] }
, despitevalue
, in this example, being arepeated int64
.Is there a reason for this behaviour? Is it possible to disable it, i.e. to tell grpcurl to format them as unqouted numbers?