I am using the RProtoBuf package, which interfaces to the c++ protobuf library.
I was wondering if there is any way of 'validating' a pb message, in the sense that you can check if it actually is a valid message for a given pb description. Currently, RProtoBuf is very permissive and will basically accept anything. E.g the code below will not throw an error, even though the file obviously is not a valid tutorial.Person message:
library(RProtoBuf)
read(tutorial.Person, "/etc/passwd")
In practice, it is quite easy to introduce errors by accidentally reading a message using the wrong description. It would be very helpful if there was a way of preventing this kind of problems by some sort of validation.
Is there support for this in the c++ library, or does protobuf basically assume that the user/application has some other way of validating a message?