Fix incorrect routes in generated client when service is not in a package (#177)

This commit is contained in:
nat 2020-11-28 17:50:25 +01:00 committed by GitHub
parent a157f05480
commit 73cea12e1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -638,7 +638,10 @@ class ServiceMethodCompiler(ProtoContentBase):
@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]: