Skip to content

Commit a7dbd77

Browse files
genopenapi: set source code info explicitly (#3544)
Fixes #3542
1 parent 212aa13 commit a7dbd77

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

protoc-gen-openapiv2/internal/genopenapi/generator.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,9 @@ func (so openapiSwaggerObject) sortPathsAlphabetically() {
433433
func AddErrorDefs(reg *descriptor.Registry) error {
434434
// load internal protos
435435
any := protodesc.ToFileDescriptorProto((&anypb.Any{}).ProtoReflect().Descriptor().ParentFile())
436+
any.SourceCodeInfo = new(descriptorpb.SourceCodeInfo)
436437
status := protodesc.ToFileDescriptorProto((&statuspb.Status{}).ProtoReflect().Descriptor().ParentFile())
438+
status.SourceCodeInfo = new(descriptorpb.SourceCodeInfo)
437439
return reg.Load(&pluginpb.CodeGeneratorRequest{
438440
ProtoFile: []*descriptorpb.FileDescriptorProto{
439441
any,

0 commit comments

Comments
 (0)