Currently, I have a JSON response of the following type.
{
"user":{
"user":{
"name":"Demo",
"age":25,
"eail":"demo@abc.com"
},
"address":{
"country":"NZ"
}
}
}
I want to map my custom class to nested user attributes.
@Data
public class Demo{
@JsonProperty("user")
private User user;
private Address address;
}
But when I am trying to get the attribute, it is always sending null
value. I think it is maping to first occurance of "user"
in line no 2.
How can I map it to correct user
attribute in line no 3.