I have some troubles with parsing JSON using Jackson library
{
"userName": "blablabla@gmail.com",
"ID": {
"uniqueID": "1234567"
}
}
This is the part of the JSON, and my model is:
public class UserIdAndMail {
@JsonProperty("uniqueID")
private String id;
@JsonProperty("userName")
private String mail;
public UserIdAndMail(String id, String mail) {
this.id = id;
this.mail = mail;
}
public UserIdAndMail() {}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getMail() {
return mail;
}
public void setMail(String mail) {
this.mail = mail;
}
}
'uniqueID'
becomes null
value when I try to parse the JSON to object. I have no idea how to get this field without creating an additional class "ID"
. Can there be a simpler solution to this task?