Skip to content

Commit 695dcc6

Browse files
authored
go: dont override name from tag if tag name is empty (#2199)
Fixes #2197
1 parent 308a837 commit 695dcc6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

parser/encoding/rpc.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -743,11 +743,13 @@ func describeParam(lang meta.Lang, encodingHints *encodingHints, field *schema.F
743743
usedOverrideTag = tag.Key
744744
}
745745
if tagHint.location == location {
746-
param.Name = tag.Name
747-
if tagHint.wireFormatter != nil {
748-
param.WireFormat = tagHint.wireFormatter(tag.Name)
749-
} else {
750-
param.WireFormat = tag.Name
746+
if tag.Name != "" {
747+
param.Name = tag.Name
748+
if tagHint.wireFormatter != nil {
749+
param.WireFormat = tagHint.wireFormatter(tag.Name)
750+
} else {
751+
param.WireFormat = tag.Name
752+
}
751753
}
752754
}
753755
if tagHint.omitEmptyOption != "" {

0 commit comments

Comments
 (0)