Skip to content

Commit

Permalink
feat(gen-openapiv2): support trailing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ionling committed Oct 19, 2022
1 parent 16369c1 commit 2295508
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions protoc-gen-openapiv2/internal/genopenapi/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -2188,6 +2188,14 @@ func protoComments(reg *descriptor.Registry, file *descriptor.File, outers []str
// - join by \n
comments = strings.Replace(comments, "\n ", "\n", -1)
}
if loc.TrailingComments != nil {
trailing := strings.TrimSpace(*loc.TrailingComments)
if comments == "" {
comments = trailing
} else {
comments += "\n\n" + trailing
}
}
return comments
}
return ""
Expand Down

0 comments on commit 2295508

Please sign in to comment.