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
I know that SerialName could overriding property name.
But what I need is Many-to-one mapping.
eg.
data class Example( @JsonAlias("tips", "errorMsg", "message") val msg: String )
"tips,errorMsg,message,msg" any of these appears in raw json data would be the value of msg property,
although the priority is arbitrary.
To work around type erasure, type info is necessary. If I can retrieve it from KSerializer,
could eliminate the need to add additional parameter.
The text was updated successfully, but these errors were encountered:
Perhaps this feature should be supported in the general case, not only for Json. It is not too hard to implement as the structure containing the field has access to the child descriptors and can search for one with the given alias. The hardest would be for the plugin to check against duplicates.
I know that SerialName could overriding property name.
But what I need is Many-to-one mapping.
eg.
data class Example( @JsonAlias("tips", "errorMsg", "message") val msg: String )
"tips,errorMsg,message,msg" any of these appears in raw json data would be the value of msg property,
although the priority is arbitrary.
To work around type erasure, type info is necessary. If I can retrieve it from KSerializer,
could eliminate the need to add additional parameter.
The text was updated successfully, but these errors were encountered: