protobuf-go/encoding/protojson
Joe Tsai 0fd4f3a506 encoding/protojson: restrict valid values for google.protobuf.Value.number_value
The purpose of struct.proto is to be an exact mapping of JSON in protobufs.
Since JSON doesn't support NaN and Inf, we should reject serialization
of such values. Prior to this CL, they would be serialzed as a JSON string,
which would change the interpretation of the value when round-tripped.

Fixes golang/protobuf#1182

Change-Id: I6dba9973b1c24d99e5688b509611c0a952c00022
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/247737
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Herbie Ong <herbie@google.com>
2020-09-04 00:11:24 +00:00
..
bench_test.go types: consistently name generated protos 2019-05-16 21:55:40 +00:00
decode_test.go reflect/protoregistry: centralize MessageSet extension resolution logic 2020-07-01 17:56:02 +00:00
decode.go encoding/protojson: use synthetic @type field for Any messages 2020-07-22 17:37:26 +00:00
doc.go protogen, encoding/jsonpb, encoding/textpb: rename packages 2019-05-14 20:33:22 +00:00
encode_test.go encoding/protojson: restrict valid values for google.protobuf.Value.number_value 2020-09-04 00:11:24 +00:00
encode.go encoding/protojson: use synthetic @type field for Any messages 2020-07-22 17:37:26 +00:00
well_known_types.go encoding/protojson: restrict valid values for google.protobuf.Value.number_value 2020-09-04 00:11:24 +00:00