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 have created a class of following structure in Kotlin:
class Specification
{
..... // Other fields
@JacksonXmlProperty(localName = "RN")
var rALNoField : Int? = null
set(value) {
field = value
}
..... //Other fields
}
Now, when the "Specification" class is serialized, the xml contains two instances of rALNoField:
With tag RN (that is correct)
With tag ralnoField (which is duplicate of same variable)
This happens due to naming of variable, when I rename the variable to "ralnoField" it works fine and only RN is output. But when variable name is "rALNoField" it output 2 instance of same variable as mentioned above.
The text was updated successfully, but these errors were encountered:
Ok, pretty sure this is not XML-specific and has to do with name-mangling.
But more importantly, is Kotlin-specific; will move to Kotlin mode issue tracker .
note: My hypothesis being that use of @JsonProperty, output as JSON would exhibit same duplication. Which I think is due to either name used, or due to way annotations are associated for Kotlin classes.
Either way, issue cannot remain at XML module since wrt reproduction (cannot have dependency to Kotlin module).
I have created a class of following structure in Kotlin:
class Specification
{
..... // Other fields
}
Now, when the "Specification" class is serialized, the xml contains two instances of rALNoField:
This happens due to naming of variable, when I rename the variable to "ralnoField" it works fine and only RN is output. But when variable name is "rALNoField" it output 2 instance of same variable as mentioned above.
The text was updated successfully, but these errors were encountered: