diff --git a/src/betterproto/plugin/models.py b/src/betterproto/plugin/models.py index bf314051e..8d487a4df 100644 --- a/src/betterproto/plugin/models.py +++ b/src/betterproto/plugin/models.py @@ -638,7 +638,10 @@ def proto_name(self) -> str: @property def route(self) -> str: - return f"/{self.output_file.package}.{self.parent.proto_name}/{self.proto_name}" + package_part = ( + f"{self.output_file.package}." if self.output_file.package else "" + ) + return f"/{package_part}{self.parent.proto_name}/{self.proto_name}" @property def py_input_message(self) -> Optional[MessageCompiler]: