Skip to content

Commit ed9ef76

Browse files
author
Comyn LI 李学明
committed
feat(protoc-gen-openapi): If fq_schema_naming is true, use service fullname as the tagname
1 parent 05a0ef7 commit ed9ef76

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/protoc-gen-openapi/generator/generator.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,9 +687,12 @@ func (g *OpenAPIv3Generator) addPathsToDocumentV3(d *v3.Document, services []*pr
687687

688688
if methodName != "" {
689689
defaultHost := proto.GetExtension(service.Desc.Options(), annotations.E_DefaultHost).(string)
690-
690+
tagName := service.GoName
691+
if g.conf.FQSchemaNaming != nil && *g.conf.FQSchemaNaming {
692+
tagName = string(service.Desc.FullName())
693+
}
691694
op, path2 := g.buildOperationV3(
692-
d, operationID, service.GoName, comment, defaultHost, path, body, inputMessage, outputMessage)
695+
d, operationID, tagName, comment, defaultHost, path, body, inputMessage, outputMessage)
693696

694697
// Merge any `Operation` annotations with the current
695698
extOperation := proto.GetExtension(method.Desc.Options(), v3.E_Operation)

0 commit comments

Comments
 (0)