Jackson deserialize based on property name
问题 I have the following two types of JSON objects: {"foo": "String value"} and {"bar": "String value"} Both of them represent a specialized type of the same base object. How can I use Jackson for deserializing them ? The type information is only represented by the keys themselves and not the value for any key (almost all examples use the value of the key for determining the type : https://github.com/FasterXML/jackson-docs/wiki/JacksonPolymorphicDeserialization) 回答1: Jackson doesn't offer an out