Skip to content

Commit d7e9be5

Browse files
fix: default spec info
1 parent a7a164f commit d7e9be5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

protoc-gen-openapiv3/internal/genopenapiv3/convertors.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package genopenapiv3
22

33
import (
44
"github.com/getkin/kin-openapi/openapi3"
5+
"google.golang.org/protobuf/proto"
6+
57
"github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor"
68
"github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv3/options"
7-
"google.golang.org/protobuf/proto"
89
)
910

1011
func convertFileOptions(target *descriptor.File) *openapi3.T {
@@ -17,7 +18,10 @@ func convertFileOptions(target *descriptor.File) *openapi3.T {
1718
}
1819
}
1920

20-
return &openapi3.T{OpenAPI: OpenAPIVersion}
21+
return &openapi3.T{OpenAPI: OpenAPIVersion, Info: &openapi3.Info{
22+
Title: target.GetName(),
23+
Version: "versoin is not set",
24+
}}
2125
}
2226

2327
func convertServers(servers []*options.Server) openapi3.Servers {
@@ -91,4 +95,3 @@ func convertSecurityRequiremnt(requirements []*options.SecurityRequirement) *ope
9195

9296
return oAPIReqs
9397
}
94-

0 commit comments

Comments
 (0)