Skip to content

Commit 73cea12

Browse files
authored
Fix incorrect routes in generated client when service is not in a package (#177)
1 parent a157f05 commit 73cea12

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/betterproto/plugin/models.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,10 @@ def proto_name(self) -> str:
638638

639639
@property
640640
def route(self) -> str:
641-
return f"/{self.output_file.package}.{self.parent.proto_name}/{self.proto_name}"
641+
package_part = (
642+
f"{self.output_file.package}." if self.output_file.package else ""
643+
)
644+
return f"/{package_part}{self.parent.proto_name}/{self.proto_name}"
642645

643646
@property
644647
def py_input_message(self) -> Optional[MessageCompiler]:

0 commit comments

Comments
 (0)