You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, even if I set [json_name = "deviceId"], the JSON still displays "deviceid",since json_name == fieldName json_name is not effective, the JSON still displays "deviceid" due to the SnakeToCamelNamingStrategy. I looked into the relevant issue where ‘json_name == fieldName json_name is not effective’ change started from #103
I think json_name is a special strategy and its priority should be higher than the general strategy - PropertyNamingStrategy. To draw a comparison: in Jackson, the priority of @JsonProperty is higher than PropertyNamingStrategy.
I know that setting PropertyNamingStrategy.LOWER_CAMEL_CASE can solve this issue. However, due to some historical reasons, some fields in protobuf classes are in LOWER_CAMEL_CASE format while others are in LOWER_UNDERSCORE format. Therefore, PropertyNamingStrategy.LOWER_CAMEL_CASE is not suitable.
BTW, I can temporarily resolve this by customizing a PropertyNamingStrategy.
jackson-datatype-protobuf: 0.9.15
jackson-databind: 2.13.2.2
protobuf-java: 3.19.2
For example, even if I set [json_name = "deviceId"], the JSON still displays "deviceid",since
json_name == fieldName
json_name is not effective, the JSON still displays "deviceid" due to theSnakeToCamelNamingStrategy
. I looked into the relevant issue where ‘json_name == fieldName
json_name is not effective’ change started from #103I think
json_name
is a special strategy and its priority should be higher than the general strategy -PropertyNamingStrategy
. To draw a comparison: in Jackson, the priority of@JsonProperty
is higher thanPropertyNamingStrategy
.I know that setting
PropertyNamingStrategy.LOWER_CAMEL_CASE
can solve this issue. However, due to some historical reasons, some fields in protobuf classes are in LOWER_CAMEL_CASE format while others are in LOWER_UNDERSCORE format. Therefore,PropertyNamingStrategy.LOWER_CAMEL_CASE
is not suitable.BTW, I can temporarily resolve this by customizing a PropertyNamingStrategy.
The text was updated successfully, but these errors were encountered: