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
This may well be an issue on the Kotlin side, but when a Kotlin class has a property that is one of the new @JvmInline value classes, Jackson converts it to JSON with a weird suffix on the field name.
e.g.
@JvmInline
value class ModelName(val value: String)
data class MyDto(val modelName: ModelName)
Jackson will produce JSON that looks like this:
{
"modelName-11MJ8YI": "Some Model Name"
}
I've tried adding a @JsonProperty("modelName") annotation but it doesn't make a difference.
UPDATE: I found this comment on a previous issue: #413 (comment)
Using @get:JsonProperty instead of @JsonProperty fixes (or works around) this issue.
I'll leave this issue open in case you think there is something that can be done on the Jackson side to handle these inline field names without having to use the extra annotation.
The text was updated successfully, but these errors were encountered:
Ahh yes, it seems we have some work to do around value classes. That postfix (-11MJ8YI) is generated by the Kotlin compiler. I think in this case they act as bridge methods to the true accessors, which means the annotations aren't present and we'll have to infer (read: guess at) the base method to find annotations or just what the method should be, sans postfix.
Could you make a minimal reproduction example? You could make a PR against 2.13 and add a test which would help us get this fixed.
This may well be an issue on the Kotlin side, but when a Kotlin class has a property that is one of the new @JvmInline value classes, Jackson converts it to JSON with a weird suffix on the field name.
e.g.
Jackson will produce JSON that looks like this:
I've tried adding a @JsonProperty("modelName") annotation but it doesn't make a difference.
UPDATE: I found this comment on a previous issue:
#413 (comment)
Using @get:JsonProperty instead of @JsonProperty fixes (or works around) this issue.
I'll leave this issue open in case you think there is something that can be done on the Jackson side to handle these inline field names without having to use the extra annotation.
The text was updated successfully, but these errors were encountered: