Closed edam closed 5 years ago
Just to elaborate... the issue with the regular map_message()
function is that is uses the protocol buffers library's nested_type_count()
and enum_type_count()
to recursively map nested messages and enums. These do not include messages and enums in other packages.
Unless I'm missing something, there doesn't appear to be a very convenient method to map a message that uses message types defined in other packages.
E.g., suppose you have these two
proto
files:a.proto:
b.proto:
And you wanted to map
a.A
, you might go as follows:But this raises the following error (actually from
resolve_references()
):Unknown type 'b.B'
It may not always be convenient to map
b.B
first. For example, in the case where you are writing a generic tool, you may not know that you have to. It would be significantly more convenient to be able to load a message and map anything it needs to a perl package prefix.