I'm having trouble in thinking up a way of parsing this type of JSON. I need to be able to access both data and message separately after getting this response inside my application.
{
"data": [
{
"email": "eskaferas@gmail.com",
"firstName": "Seras",
"lastName": "Meras"
},
{
"email": "Soras@gmail.com",
"firstName": "Oras",
"lastName": "Moras"
},
{
"email": "bzbzb@gmail.com",
"firstName": "hello",
"lastName": "bye"
},
{
"email": "lrc@gmail.com",
"firstName": "Seras",
"lastName": "Meras"
}
],
"message": "Success"
}
Could anyone suggest a method specifically for Spring boot? Or a common way that is used in Spring boot to parse this type of JSON.
Thank you.
EDIT
My main questions would be just what tool can be used for Spring Boot and what would my POJO class look like if I used Jackson. Would it be something like this?:
public class testPojo {
Users[] users;
String message;
}