Skip to content

Commit

Permalink
Merge pull request #16 from webrpc/use_comments
Browse files Browse the repository at this point in the history
show summary if any comment is present
  • Loading branch information
LukasJenicek authored Mar 6, 2024
2 parents 4829514 + f3150b4 commit 1947743
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- name: Install webrpc-gen
run: |
curl -o ./webrpc-gen -fLJO https://github.com/webrpc/webrpc/releases/download/v0.14.2/webrpc-gen.linux-amd64
curl -o ./webrpc-gen -fLJO https://github.com/webrpc/webrpc/releases/download/v0.14.3/webrpc-gen.linux-amd64
chmod +x ./webrpc-gen
echo $PWD >> $GITHUB_PATH
Expand Down
4 changes: 2 additions & 2 deletions _examples/openapi.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# example v0.0.1 a690751537facece7a7d040de043a2b9c3a1ee94
# example v0.0.1 2b7f54ec87d95d472145c1e137844eb76a239e1f
# --
# Code generated by [email protected].2 with ../ generator; DO NOT EDIT
# Code generated by [email protected].3 with ../ generator; DO NOT EDIT
#
# webrpc-gen -schema=./proto.ridl -target=../ -out=./openapi.gen.yaml -title=Example webrpc API -apiVersion=v22.11.8 -serverUrl=https://api.example.com -serverDescription=Production
openapi: 3.0.0
Expand Down
3 changes: 3 additions & 0 deletions main.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ paths:
{{- range $_, $method := .Methods}}
/rpc/{{$service.Name}}/{{$method.Name}}:
post:
{{- if gt (len $method.Comments) 0 }}
summary: '{{ join $method.Comments "\n" }}'
{{- end }}
requestBody:
content:
application/json:
Expand Down

0 comments on commit 1947743

Please sign in to comment.