@@ -69,7 +69,7 @@ func SetJSONCaseStyle(name string, style string, idUppercase bool) string {
6969 case "camel" :
7070 return toJsonCamelCase (name , idUppercase )
7171 case "pascal" :
72- return toPascalCase (name )
72+ return toJsonPascalCase (name , idUppercase )
7373 case "snake" :
7474 return toSnakeCase (name )
7575 default :
@@ -95,6 +95,9 @@ func toCamelCase(s string) string {
9595func toPascalCase (s string ) string {
9696 return toCamelInitCase (s , true )
9797}
98+ func toJsonPascalCase (s string , idUppercase bool ) string {
99+ return toJsonCamelInitCase (s , true , idUppercase )
100+ }
98101
99102func toCamelInitCase (name string , initUpper bool ) string {
100103 out := ""
@@ -113,6 +116,10 @@ func toCamelInitCase(name string, initUpper bool) string {
113116}
114117
115118func toJsonCamelCase (name string , idUppercase bool ) string {
119+ return toJsonCamelInitCase (name , false , idUppercase )
120+ }
121+
122+ func toJsonCamelInitCase (name string , initUpper bool , idUppercase bool ) string {
116123 out := ""
117124 idStr := "Id"
118125
@@ -121,7 +128,7 @@ func toJsonCamelCase(name string, idUppercase bool) string {
121128 }
122129
123130 for i , p := range strings .Split (name , "_" ) {
124- if i == 0 {
131+ if ! initUpper && i == 0 {
125132 out += p
126133 continue
127134 }
0 commit comments