-
-
Notifications
You must be signed in to change notification settings - Fork 240
Exception when parsing Lists of mixed content (since 2.13.0) #509
Copy link
Copy link
Closed
Milestone
Description
In Jackson 2.12 the following junit example test (written in Kotlin) works as I'd expect it to
@JsonIgnoreProperties(ignoreUnknown = true)
data class Tspan(
@field:JacksonXmlText
var content: String? = null
)
@JsonIgnoreProperties(ignoreUnknown = true)
class Text(
@field:JacksonXmlElementWrapper(useWrapping = false)
@field:JacksonXmlProperty(localName = "tspan")
var spans: List<Tspan>? = null
)
class ExampleTest {
@Test
fun svgExample() {
val text = XmlMapper().readValue("<text>Mixed <tspan>content</tspan> should<tspan> work</tspan></text>", Text::class.java)
assertThat(text.spans, hasSize(2))
}
}But when I upgrade to 2.13, I get the following error
Unexpected non-whitespace text (' should' in Array context: should not occur (or should be handled)
at [Source: (StringReader); line: 1, column: 49] (through reference chain: com.visualdx.api.kmax.graphql.Text["tspan"])
com.fasterxml.jackson.databind.JsonMappingException: Unexpected non-whitespace text (' should' in Array context: should not occur (or should be handled)
at [Source: (StringReader); line: 1, column: 49] (through reference chain: com.visualdx.api.kmax.graphql.Text["tspan"])
This feels like a bug, but I'm not sure if there's some workaround or setting I'm missing somewhere.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels