{"field": {"11815": {"name": "email","value": "snow.fx@qq.com"},"11816": {"name": "storeid","value": "11"},"12116": {"name": "idcardtypeid","value": "1"},"12117": {"name": "idcardno","value": "320282199207071967"}},"birthday": "1992-7-7","name": "cccc","gender": 2,"openid": "90738","mobile": "1000"}
this is the json string, I wanna parse it to a entity class, define like:
@JsonIgnoreProperties(ignoreUnknown = true)
public class Userinfo(){String name; int gender; .... ; JSONObject field}
I used ObjectMapper to parse, code is:
Userinfo userinfo = new ObjectMapper().readValue(jsonStr ,Userinfo.class)
but it still give error message 'Unrecognized field "11216", not marked as i ignorable'.
"birthday", "name", "mobile", "openid", easy to solve. but "field" has "11815","11816","12116","12117", I can't define a variable named "11815", it's illegal in Java