Skip to content

Commit

Permalink
Merge pull request #18 from webrpc/description
Browse files Browse the repository at this point in the history
use method name as summary and comments as description
  • Loading branch information
LukasJenicek committed Mar 18, 2024
2 parents 7698afa + 1e89295 commit 52e43d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion _examples/openapi.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ components:
paths:
/rpc/ExampleService/GetUser:
post:
summary: GetUser
requestBody:
content:
application/json:
Expand Down Expand Up @@ -515,6 +516,7 @@ paths:
- $ref: '#/components/schemas/ErrorDatabaseDown'
/rpc/ExampleService/FindUser:
post:
summary: FindUser
requestBody:
content:
application/json:
Expand Down Expand Up @@ -553,6 +555,7 @@ paths:
- $ref: '#/components/schemas/ErrorDatabaseDown'
/rpc/ExampleService/ListUsers:
post:
summary: ListUsers
requestBody:
content:
application/json:
Expand Down Expand Up @@ -591,6 +594,7 @@ paths:
- $ref: '#/components/schemas/ErrorDatabaseDown'
/rpc/ExampleService/GetComplex:
post:
summary: GetComplex
requestBody:
content:
application/json:
Expand Down Expand Up @@ -629,6 +633,7 @@ paths:
- $ref: '#/components/schemas/ErrorDatabaseDown'
/rpc/ExampleService/GetAllOptional:
post:
summary: GetAllOptional
requestBody:
content:
application/json:
Expand Down Expand Up @@ -667,6 +672,7 @@ paths:
- $ref: '#/components/schemas/ErrorDatabaseDown'
/rpc/ClonedService/ListUsers:
post:
summary: ListUsers
requestBody:
content:
application/json:
Expand Down Expand Up @@ -702,4 +708,4 @@ paths:
- $ref: '#/components/schemas/ErrorWebrpcBadResponse'
- $ref: '#/components/schemas/ErrorWebrpcServerPanic'
- $ref: '#/components/schemas/ErrorWebrpcInternalError'
- $ref: '#/components/schemas/ErrorDatabaseDown'
- $ref: '#/components/schemas/ErrorDatabaseDown'
3 changes: 2 additions & 1 deletion main.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ paths:
{{- range $_, $method := .Methods}}
/rpc/{{$service.Name}}/{{$method.Name}}:
post:
summary: {{$method.Name}}
{{- if gt (len $method.Comments) 0 }}
summary: "{{ replaceAll (join $method.Comments "\n") "\"" "'" }}"
description: "{{ replaceAll (join $method.Comments "\n") "\"" "'" }}"
{{- end }}
requestBody:
content:
Expand Down

0 comments on commit 52e43d8

Please sign in to comment.