----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/66025/#review199102 -----------------------------------------------------------
Fix it, then Ship it! 3rdparty/stout/include/stout/protobuf.hpp Lines 469 (patched) <https://reviews.apache.org/r/66025/#comment279387> `"Failed to parse '" + ... + '" as a JSON number...` since we're using the same parse function no matter what the actual field type is. 3rdparty/stout/include/stout/protobuf.hpp Lines 470 (patched) <https://reviews.apache.org/r/66025/#comment279388> `s/for the field/for field`. Ditto below. 3rdparty/stout/include/stout/protobuf.hpp Lines 479 (patched) <https://reviews.apache.org/r/66025/#comment279389> `"Failed to parse '" ... " as a JSON boolean"...` - Chun-Hung Hsiao On March 13, 2018, 6:48 a.m., Qian Zhang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/66025/ > ----------------------------------------------------------- > > (Updated March 13, 2018, 6:48 a.m.) > > > Review request for mesos, Benjamin Mahler and Chun-Hung Hsiao. > > > Bugs: MESOS-8656 > https://issues.apache.org/jira/browse/MESOS-8656 > > > Repository: mesos > > > Description > ------- > > Previsouly when converting a JSON to a protobuf message in stout, we > cannot handle the fields like below which are actually valid. > "int32": "-2147483647" > "int64": "-9223372036854775807" > "float": "1.5" > "bool": "true" > The conversion will fail with an error like "Not expecting a JSON string > for field 'int32'". > > So in this patch, `Try<Nothing> operator()(const JSON::String& string)` > was enhanced to be able to convert `JSON::String` to bool and numbers. > This is to match Google's json -> protobuf behavior, see the doc below > for details: > https://developers.google.com/protocol-buffers/docs/proto3#json > > > Diffs > ----- > > 3rdparty/stout/include/stout/protobuf.hpp > 4a1605e5130dbf7e8286dbb43d0d04ab4394e79a > > > Diff: https://reviews.apache.org/r/66025/diff/2/ > > > Testing > ------- > > sudo make check > > > Thanks, > > Qian Zhang > >
