Note that the JSON protobuf format represents bytes as base64 string:
https://developers.google.com/protocol-buffers/docs/proto3#json
I think you assume the bytes are going to be represented as an hexstring in
the json, given your earlier question
<https://groups.google.com/forum/#!topic/protobuf/qugKZT26aLg>.
-Nadav
On Thursday, September 5, 2019 at 11:45:15 PM UTC-7, arun kumar wrote:
>
> I have JSON data like below,
>
> {
> "clientIdentifier": {
> "context": "CFID",
> "value": "12340000"
> },
> "desiredSessionTimeout": "30000"
> }
>
> Value 12340000 is the datatype of " ByteString " as per proto
>
> When I am trying to parse using JSON parser
>
> Google.Protobuf.JsonParser parser = Google.Protobuf.JsonParser.Default;
> IMessage imesg= parser.Parse(json, MessageDescriptor);
>
> imesg is getting created but the value is being return as 12340000.
> Because of this , serialized data is showing wrong value. I tried
> JSONParser settings as well. But I couldnt get the desired result..
>
> I got struck at this point. Please help me out
>
> Thanks in Advance,
> Arun
>
--
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/37f435a7-3650-419e-8deb-0478f4f11c69%40googlegroups.com.