FasterXML / FasterXML/jackson-module-kotlin
Jackson 2.12.3 and later fails to collapse XML list using @JsonAlias
- Dominant language
- Kotlin
- Stars
- 1.2k
- Forks
- 187
- Avg merge
- 9h 48m
- Merged PRs (30d)
- 16
Description
As described in [this blog post](https://medium.com/@foxjstephen/how-to-actually-parse-xml-in-java-kotlin-221a9309e6e8) it has been possible to deserialize this:
```
1056.38
Simple
```
... into a collaped list like this:
```
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 = 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`
Here's a test project: https://github.com/henrik242/jackson-xml-problem/blob/list-wrappers/src/test/kotlin/jackson/xml/ListWrappersTest.kt
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.