there is a json text like this
{"name":"g1","users":"[{\"name\":\"u1\",\"id\":1},{\"name\":\"u2\",\"id\":2}]"}
how to deserialize this text to object? my struct class is like this
static class User {
private String name;
private Long id;
}
static class Group {
private String name;
private List<User> users;
}
but how to deserialize the text to object
ObjectMapper objectMapper = new ObjectMapper();
Group group = objectMapper.readValue(s, Group.class);
{"name":"g1","users":[{"name":"u1","id":1},{"name":"u2","id":2}]}