-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71158/
-----------------------------------------------------------
(Updated July 29, 2019, 2:52 p.m.)
Review request for mesos, Andrei Sekretenko, Benjamin Bannier, and Benjamin
Mahler.
Changes
-------
Addressed Ben's comment.
Summary (updated)
-----------------
Fixed non-standard mapping for protobuf map fields in jsonify.
Bugs: MESOS-9901
https://issues.apache.org/jira/browse/MESOS-9901
Repository: mesos
Description (updated)
-------
Before this patch jsonify treats protobuf Map as a regular
repeated field. This means a Map with schema:
message QuotaConfig {
required string role = 1;
map<string, Value.Scalar> guarantees = 2;
map<string, Value.Scalar> limits = 3;
}
may be jsonify to an JSON array:
{
"configs": [
{
"role": "role1",
"guarantees": [
{
"key": "cpus",
"value": {
"value": 1
}
},
{
"key": "mem",
"value": {
"value": 512
}
}
]
}
]
}
Per standard proto3 JSON mapping, the Map type should be mapped
to an JSON object, i.e.
{
"configs": [
{
"role": "role1",
"guarantees": {
"cpus": 1,
"mem": 512
}
}
]
}
This patch made jsonify support for such mapping.
Currently, there is no egress of map fields in the code base,
so this presents no external visible change.
Diffs (updated)
-----
3rdparty/stout/include/stout/protobuf.hpp
4b3db7eb807723359af85e8a0324b176e49a954a
Diff: https://reviews.apache.org/r/71158/diff/3/
Changes: https://reviews.apache.org/r/71158/diff/2-3/
Testing
-------
make check
Thanks,
Meng Zhu