-
-
Notifications
You must be signed in to change notification settings - Fork 185
Open
Labels
Description
Would it be possible to create an option for the encoder to be able to specify the case style the struct fields are marshalled with?
For example, if we have
type mystruct struct {
FieldOne string
FieldTwo string
} the output will be
{
"FieldOne" : "",
"FieldTwo" : ""
}but if we could specify an option to convert to say camelcase (even something as simple as lowercase the first letter) to get
{
"fieldOne" : "",
"fieldTwo" : ""
}it would be much nicer than manually specifying json tags! Not sure how it would look in terms of performance. Obviously a general solution is a callback/transformation function of some kind, or could just support camelCase as that would be fast.
System-Glitch, buzzki11, zzztttkkk, vincentfree, lafriks and 3 morezzjin and kislerdm