We serialize the proto file (proto3) and send it via nats as follows.
We subscribe and receive the data from the sent side, we convert this data to json with message to json as follows.
std::string req_message_str;
google::protobuf::util::MessageToJsonString(deserialized_set_ru_conf, &req_message_str);
std::cout<<req_message_str<<std::endl;
We see that the default values are not serialized and sent in the incoming data, but we also have the following observation:
If the parameter is optional, even though it has a default value, it is serialized and the data comes to us, but we use a non-optional parameter.
We want to serialize and send the parameter and see that data after the message to json. Can you help me with this?
I want to see non-optional fields in JSON. Maybe I needed to pass an argument like JsonPrintOptions, but I’m not sure.