Hello,
I am not sure if this is the right place to ask this question.
we are currently running a python application that receives json messages,
parse it according to the given dict using *ParseDict* , serialize it
*SerializeToString* and send it.
*# encode.py payload = ParseDict(data, data_t_v1()) raw_payload =
payload.SerializeToString()*
This what we have in proto file:
*//data.proto syntax = "proto2"; message data_t_v1 { required uint32 id =
1; optional uint32 offset = 2; optional uint32 multiplier = 3; optional
uint32 mask = 4; }*
However, I have an issue concerning the *values of optional attributes*.
Here is what happens:
Step 1- sending the message with the optional values
data = {
"id": 1,
"offset": 2,
"multiplier":10,
"mask": 4294967295 }
Step 2- sending the same message without the optional values
data = {
"id": 1 }
The issue happens here: *ParseDict* is returning a dict with the optional
attributes having the old value that I set in step 1.
I would like to know if there is a way to clear old optional values when
they are not set.
Thanks in advance. and Please let me know if you need additional information
--
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/2a31e7c7-4532-4f4c-b58b-6d43b19d10c0n%40googlegroups.com.