Details
Description
The followings are valid in JSON which can be successfully parsed by Google's protobuf utility function JsonStringToMessage() but can NOT be parsed our stout, i.e., call JSON::parse() to convert the JSON to a stout JSON object and then call protobuf::parse() to parse the JSON object to a protobuf message.
"int32": "-2147483647" "int64": "-9223372036854775807" "bool": "true"
The second step (protobuf::parse()) will fail with an error like this:
Not expecting a JSON string for field 'int32'
This error comes from Try<Nothing> operator()(const JSON::String& string) which currently can only convert JSON::String to protobuf string/bytes/enum, so we need to enhance it to be able to convert JSON::String to bools and integers.
What we can parse currently are:
"int32": -2147483647 "int64": -9223372036854775807 "bool": true
We should make the behavior of our stout JSON -> protobuf conversion consistent with Google's.