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
data class LedgerActivityDetail(
@set:JsonProperty("TransactionType")
var loanType: String? = null,
@set:JsonProperty("Amount")
var amount: String? = null
)
@JsonRootName("LedgerActivityObject")
data class LedgerActivity(
@set:JsonProperty("LedgerTransactionDate")
var LedgerTransactionDate: String? = null,
@set:JsonProperty("Amount")
var amount: String? = null,
// HERE IS WHERE THE MAGIC HAPPENS!!!
@set:JsonAlias("LedgerTransactionDetails", "LedgerActivityDetailObject")
var LedgerActivityDetails: List<LedgerActivityDetail> = ArrayList()
)
This worked until jackson 2.12.2. In 2.12.3 and onwards (including 2.16.0-rc1) the inner values of LedgerActivityDetail are null
From little reading this does not seem like a reliable way to work around problems, i.e. might appear to work by accident more than intentionally.
But as usual, one important part in de-tangling problems is trying to figure out what part is due to Kotlin (annotations being associated with accessors as needed), and which XML format module (and possibly even jackson-databind occasionally).
So pure-Java reproduction would be useful to show something is not Kotlin-specific (if so).
As described in this blog post it has been possible to deserialize this:
... into a collaped list like this:
This worked until jackson 2.12.2. In 2.12.3 and onwards (including 2.16.0-rc1) the inner values of LedgerActivityDetail are
null
Here's a test project: https://github.com/henrik242/jackson-xml-problem/blob/list-wrappers/src/test/kotlin/jackson/xml/ListWrappersTest.kt
The text was updated successfully, but these errors were encountered: