-
-
Notifications
You must be signed in to change notification settings - Fork 180
Open
Labels
Description
Annotations given to someCrazyFieldName
will not work for ChildClass
if written as follows.
// from #151
open class SuperClass(@JsonProperty("annotationName") val someCrazyFieldName: String)
class ChildClass(s: String) : SuperClass(s)
The reason for this behavior is that the constructor of the superclass is not parsed by Jackson
(note that in the sample, the annotation is given to the constructor arguments).
About Workaround
In such cases, the annotation should be given to the getter or field.
open class SuperClass(@get:JsonProperty("annotationName") val someCrazyFieldName: String)
/* or */
open class SuperClass(@field:JsonProperty("annotationName") val someCrazyFieldName: String)
About the planned implementation of this feature
There are many difficulties in implementing this feature, and it also causes performance degradation.
Therefore, we do not plan to implement this feature.
The details are summarized in this comment.