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
If I have a bytes field and set the value something like <int>[999999] (i.e. an integer list with integers larger than max value of a byte), binary serializer silently truncates the integer value, but JSON map and proto3 JSON serializers throw an exception.
Exception thrown by JSON map encoder:
Invalid argument (Not a byte value at index 0: 0x1869f): Instance(length:1) of '_GrowableList'
#0 _Base64Encoder.encodeChunk (dart:convert/base64.dart:374:5)
#1 _Base64Encoder.encode (dart:convert/base64.dart:328:9)
#2 Base64Encoder.convert (dart:convert/base64.dart:243:26)
#3 Codec.encode (dart:convert/codec.dart:21:32)
#4 base64Encode (dart:convert/base64.dart:41:48)
#5 _writeToJsonMap.convertToMap (package:protobuf/src/protobuf/json.dart:40:16)
#6 _writeToJsonMap (package:protobuf/src/protobuf/json.dart:79:33)
#7 GeneratedMessage.writeToJsonMap (package:protobuf/src/protobuf/generated_message.dart:203:44)
#8 GeneratedMessage.writeToJson (package:protobuf/src/protobuf/generated_message.dart:218:38)
Exception thrown by proto3 JSON encoder:
Unhandled exception:
Invalid argument (Not a byte value at index 0: 0x1869f): Instance(length:1) of '_GrowableList'
#0 _Base64Encoder.encodeChunk (dart:convert/base64.dart:374:5)
#1 _Base64Encoder.encode (dart:convert/base64.dart:328:9)
#2 Base64Encoder.convert (dart:convert/base64.dart:243:26)
#3 Codec.encode (dart:convert/codec.dart:21:32)
#4 base64Encode (dart:convert/base64.dart:41:48)
#5 _writeToProto3Json.valueToProto3Json (package:protobuf/src/protobuf/proto3_json.dart:77:18)
#6 _writeToProto3Json (package:protobuf/src/protobuf/proto3_json.dart:108:19)
#7 GeneratedMessage.toProto3Json (package:protobuf/src/protobuf/generated_message.dart:235:7)
The text was updated successfully, but these errors were encountered:
Originally reported in #219 (comment)
If I have a
bytes
field and set the value something like<int>[999999]
(i.e. an integer list with integers larger than max value of a byte), binary serializer silently truncates the integer value, but JSON map and proto3 JSON serializers throw an exception.Exception thrown by JSON map encoder:
Exception thrown by proto3 JSON encoder:
The text was updated successfully, but these errors were encountered: