mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Qian Zhang <>
Subject Re: Review Request 66025: Converted `JSON::String` to bool and numbers.
Date Wed, 14 Mar 2018 01:30:12 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated March 14, 2018, 9:30 a.m.)

Review request for mesos, Benjamin Mahler and Chun-Hung Hsiao.


Addressed review comments.

Bugs: MESOS-8656

Repository: mesos


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:

Diffs (updated)

  3rdparty/stout/include/stout/protobuf.hpp 4a1605e5130dbf7e8286dbb43d0d04ab4394e79a 




sudo make check


Qian Zhang

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message