Basically, I have the JSON file below and I need to read him and add into a List of Objects in Java, Which library should I use in this case? My biggest difficulty is read the Json starting with the array instead of a normal object, and inside the elements of the first array try to read the other array inside.
[
{
"name: "Andrew",
"age": 21,
"parents": [
{
"name": "Joseph",
"age": 18
},
{
"name": "Joseph",
"age": 18
}
]
},
{
"name: "Maria",
"age": 35,
"parents": [
{
"name": "Kassandra",
"age": 16
},
{
"name": "Abigail",
"age": 22
}
]
}
]
[EDIT 06/11/2022]
I created this github gist below for the answer of this problem, Thank you everyone for the help I appreciate.
Answer: https://gist.github.com/guigonzalezz/fcd8724ce0075efcb486763c067565c2
<dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.9.0</version> </dependency>