Given a protobuf serialization is it possible to get a list of all tag numbers that are in the message? Generally is it possible to view the structure of the message without the defining .proto files?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Most APIs will indeed have some form of reader-based API that allows you to enumerate a raw protobuf stream. However, that by itself is not enough to fully understand the data, since without the schema the interpretation is ambiguous:
sint32/sint64), or not (int32/int64/uint32/uint64) – radically changing the meaning, or a boolean, or an enumSo… yes and no. Certainly you can get the field numbers of the outermost message.
Another approach would be to use the regular API against a type with no members (
message Naked {}), and then query the unexpected data (i.e. all of it) via the “extension” API that many implementations provide.