Skip to content

Commit

Permalink
protoc-gen-swagger optional SourceCodeInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
emcfarlane committed Sep 27, 2017
1 parent 8bec008 commit 8a3c994
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions protoc-gen-swagger/genswagger/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,13 +722,8 @@ func enumValueProtoComments(reg *descriptor.Registry, enum *descriptor.Enum) str

func protoComments(reg *descriptor.Registry, file *descriptor.File, outers []string, typeName string, typeIndex int32, fieldPaths ...int32) string {
if file.SourceCodeInfo == nil {
// Curious! A file without any source code info.
// This could be a test that's providing incomplete
// descriptor.File information.
//
// We could simply return no comments, but panic
// could make debugging easier.
panic("descriptor.File should not contain nil SourceCodeInfo")
// SourceCodeInfo is optional
return ""
}

outerPaths := make([]int32, len(outers))
Expand Down

0 comments on commit 8a3c994

Please sign in to comment.