FasterXML / FasterXML/jackson-dataformat-xml
Polymorphic deserialization based on root tag
- Dominant language
- Java
- Stars
- 631
- Forks
- 246
- Avg merge
- 7d 9h
- Merged PRs (30d)
- 13
Description
Hello!
I am not sure if this is a help or a feature request. I scoured google/SO trying to dynamically select target class based on the root tag. I expected the usage to be something like this:
```java
xmlMapper.readValue(data, MyAbstractPojo.class)
```
where `MyAbstractPojo` is annotated with `@JsonTypeInfo` and `@JsonSubTypes` to configure type selection. However, root tag is not a property, not an external property and not a wrapper object, which means it's not helpful to use those. Even if you use `DEDUCTION` as a mechanism, only property names are considered, root tag is again ignored.
So I wanted to ask whether I have missed something obvious, and if I did not, consider implementing this feature for the XML module.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.