Open adriangaro opened 2 years ago
Adding the line self.py_input_message_type
at line 692 in that file seems to work, also betterproto version 2.0.0-beta5
For those with this issue who note that the line number is out of date on the current build, here's where that was referring to: https://github.com/danielgtaylor/python-betterproto/blob/8fbf4476a8f4a9c9a8bb07a64cc0bbb379e0afa8/src/betterproto/plugin/models.py#L688-L694
As a basic example I have the below, the generated service will not import the
test
package, however if i reference any message in the return it imports it correctly.From a shallow look seems to stem from the
ServiceMethodCompiler.__post_init__
method. The return type is referenced usingpy_output_message_type
which callsget_type_reference
which adds it to imports, however nowhere in the__post_init__
is the input type referenced for it to be added withget_type_reference
to imports.