Skip to content

Commit

Permalink
Allow empty services. Fixes issue#220
Browse files Browse the repository at this point in the history
  • Loading branch information
qria committed Mar 9, 2021
1 parent 6c1c41e commit b177ccd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/betterproto/templates/template.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ class {{ service.py_name }}Stub(betterproto.ServiceStub):
{% if service.comment %}
{{ service.comment }}

{% elif not service.methods %}
pass
{% endif %}
{% for method in service.methods %}
async def {{ method.py_name }}(self
Expand Down
7 changes: 7 additions & 0 deletions tests/inputs/empty/empty.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* Empty service without comments */
syntax = "proto3";

package empty;

service Test {
}

0 comments on commit b177ccd

Please sign in to comment.