I have a POJO like this:
public class NewClass {
String name;
@JsonProperty("productType")
ProductType productType2005;
List<ProductType> productType;
}
I want to deserialize json into Pojo. The issue is I have property name same productType but I can expect two different return types or data structures.
ProductType
objectList<ProductType>
since property name is the same how can I effectively use Jackson annotations to get it resolved? I'm using rest-assured for deserialization and Lombok for typical getter and setters.
To my knowledge, this isn't possible. A solution would be to expect a List of ProductType objects with a minimum of at least one if required.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.