[jira] [Commented] (MESOS-9901) Specialize jsonify for protobuf Maps.

2019-07-23 Thread Meng Zhu (JIRA)


[ 
https://issues.apache.org/jira/browse/MESOS-9901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16891299#comment-16891299
 ] 

Meng Zhu commented on MESOS-9901:
-

[~bbannier] Thanks for pointing to the test. But, despite the name, the test 
dose not really use jsonify
https://github.com/apache/mesos/blob/ff8c9a96be6ae1ee47faf9d5b80a518dfb4a3db0/3rdparty/stout/tests/protobuf_tests.cpp#L838-L839

> Specialize jsonify for protobuf Maps.
> -
>
> Key: MESOS-9901
> URL: https://issues.apache.org/jira/browse/MESOS-9901
> Project: Mesos
>  Issue Type: Improvement
>  Components: json api
>Reporter: Meng Zhu
>Priority: Major
>
> Jsonify current treats protobuf as a regular repeated field. For example, for 
> the schema 
> {noformat}
> message QuotaConfig {
>   required string role = 1;
>   map guarantees = 2;
>   map limits = 3;
> }
> {noformat}
> it will produce:
> {noformat}
>   "configs": [
> {
>   "role": "role1",
>   "guarantees": [
> {
>   "key": "cpus",
>   "value": {
> "value": 1
>   }
> },
> {
>   "key": "mem",
>   "value": {
> "value": 512
>   }
> }
>   ]
> {noformat}
> This output cannot be parsed back to proto messages. We need to specialize 
> jsonify for Maps type. 



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (MESOS-9901) Specialize jsonify for protobuf Maps.

2019-07-23 Thread Benjamin Mahler (JIRA)


[ 
https://issues.apache.org/jira/browse/MESOS-9901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16891171#comment-16891171
 ] 

Benjamin Mahler commented on MESOS-9901:


[~bbannier] hm.. not sure how the existing format was produced but it doesn't 
comply with the standard mapping?

https://developers.google.com/protocol-buffers/docs/proto3#json

I think we should just bite the bullet and send out an email to make the 
breaking change to get towards the proto3 standard json mapping.

> Specialize jsonify for protobuf Maps.
> -
>
> Key: MESOS-9901
> URL: https://issues.apache.org/jira/browse/MESOS-9901
> Project: Mesos
>  Issue Type: Improvement
>  Components: json api
>Reporter: Meng Zhu
>Priority: Major
>
> Jsonify current treats protobuf as a regular repeated field. For example, for 
> the schema 
> {noformat}
> message QuotaConfig {
>   required string role = 1;
>   map guarantees = 2;
>   map limits = 3;
> }
> {noformat}
> it will produce:
> {noformat}
>   "configs": [
> {
>   "role": "role1",
>   "guarantees": [
> {
>   "key": "cpus",
>   "value": {
> "value": 1
>   }
> },
> {
>   "key": "mem",
>   "value": {
> "value": 512
>   }
> }
>   ]
> {noformat}
> This output cannot be parsed back to proto messages. We need to specialize 
> jsonify for Maps type. 



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (MESOS-9901) Specialize jsonify for protobuf Maps.

2019-07-23 Thread Benjamin Bannier (JIRA)


[ 
https://issues.apache.org/jira/browse/MESOS-9901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16890778#comment-16890778
 ] 

Benjamin Bannier commented on MESOS-9901:
-

[~mzhu], could you document the expected behavior? AFAICT we already e.g., test 
that output produced by {{JSON::protobuf}} can be parsed back to proto maps, 
see {{ProtobufTest.JsonifyMap}} in {{3rdparty/stout/tests/protobuf_tests.cpp}}. 
If we do any changes there we should make sure to not break our JSON API.

> Specialize jsonify for protobuf Maps.
> -
>
> Key: MESOS-9901
> URL: https://issues.apache.org/jira/browse/MESOS-9901
> Project: Mesos
>  Issue Type: Improvement
>  Components: json api
>Reporter: Meng Zhu
>Priority: Major
>
> Jsonify current treats protobuf as a regular repeated field. For example, for 
> the schema 
> {noformat}
> message QuotaConfig {
>   required string role = 1;
>   map guarantees = 2;
>   map limits = 3;
> }
> {noformat}
> it will produce:
> {noformat}
>   "configs": [
> {
>   "role": "role1",
>   "guarantees": [
> {
>   "key": "cpus",
>   "value": {
> "value": 1
>   }
> },
> {
>   "key": "mem",
>   "value": {
> "value": 512
>   }
> }
>   ]
> {noformat}
> This output cannot be parsed back to proto messages. We need to specialize 
> jsonify for Maps type. 



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)