My requirement is to share the data JSON to proto-buf. I have JSON data. How to write a schema genric for handling all types of value.
{
"data": [
{
"bool": true
},
{
"string": "abc"
},
{
"int": 22
},
{
"json_object" : {
"id": 1,
"email": "example@gmail.com"
}
},
{
"json_array" : [
{
"name":"xyz"
},
{
"age":2
}
]
}
]
}
If, I am using Map<string, string>
map. It's supported string value only.
If, I am using Map<string, google.protobuf.Value>
map. The Value is not supported by JSON
and JSONArray
.
How do I handle all types in a single schema?. Thanks