Skip to content

Commit

Permalink
feat(protoc-gen-openapi): If fq_schema_naming is true, use service fu…
Browse files Browse the repository at this point in the history
…llname as the tagname
  • Loading branch information
comynli authored and Comyn LI 李学明 committed Nov 15, 2022
1 parent 05a0ef7 commit 4e71484
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/protoc-gen-openapi/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,9 +687,12 @@ func (g *OpenAPIv3Generator) addPathsToDocumentV3(d *v3.Document, services []*pr

if methodName != "" {
defaultHost := proto.GetExtension(service.Desc.Options(), annotations.E_DefaultHost).(string)

tagName := service.GoName
if g.conf.FQSchemaNaming != nil && *g.conf.FQSchemaNaming {
tagName = string(service.Desc.FullName())
}
op, path2 := g.buildOperationV3(
d, operationID, service.GoName, comment, defaultHost, path, body, inputMessage, outputMessage)
d, operationID, tagName, comment, defaultHost, path, body, inputMessage, outputMessage)

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

0 comments on commit 4e71484

Please sign in to comment.