Skip to content

Commit

Permalink
feat: json param user origin JSONName
Browse files Browse the repository at this point in the history
  • Loading branch information
GaoShuai committed Mar 8, 2024
1 parent 01b591a commit 1a387d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/utils/common.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package utils

var VERSION = "2.1.5"
var VERSION = "2.1.6"

const DeprecationComment = "// Deprecated: Do not use."
const StringType = "string"
Expand Down
3 changes: 2 additions & 1 deletion internal/utils/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ func (fp *FieldParam) GetEnums() string {
func ParseFieldLeading(field *protogen.Field) *FieldParam {
leading := field.Comments.Leading.String()
param := parseLeading(leading)
param.FName = JSONSnakeCase(field.GoName)
//param.FName = JSONSnakeCase(field.GoName)
param.FName = field.Desc.JSONName()
if !param.FRequired {
param.FRequired = strings.Contains(leading, Required)
}
Expand Down

0 comments on commit 1a387d4

Please sign in to comment.