If I copy struct.proto into a different namespace and convert messages 
based on it to JSON, the conversion adds extra maps to the data.

message built using struct.proto:

string_param: {
 "oid": "HelloWorld",
 "name": "My nice parameter",
 "type": "STRING",
 "readonly": true,
 "widget": "default",
 "precision": 2,
 "value": "Evacuate the studio!"
}

message built using the same code but in a different namespace:

native_string_param: {
 "oid": "HelloWorld",
 "name": "My nice parameter",
 "type": "STRING",
 "readonly": true,
 "widget": "default",
 "precision": 2,
 "value": {
  "string_value": "Evacuate the studio!"
 }
}

note the extra "string_value" mapping.

Is there a way to have MessageToJsonString treat the second type of message 
the same way as it does struct.proto ones?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/a62e3285-8951-463b-b424-629f4a43efc1n%40googlegroups.com.

Reply via email to