Is there a way to assign a unique name to each element in a JSON list using JACKSON?
For instance, consider the following JSON data:
{"result": [
{
"name": "ABC",
"age": "20"
},{
"name": "DEF",
"age": "12"
}
]}
However, I require the following structure:
{"result": [
person: { // This serves as the unique name for the element
"name": "ABC",
"age": "20"
},
person: {
"name": "DEF",
"age": "12"
}
]}
Appreciate the assistance!
UPDATE
Hello everyone!
I made a mistake in the previous example! The correct format is as follows:
{"result": [
{
person: { // This acts as the unique name for the element
"name": "ABC",
"age": "20"
}
},
{
person: {
"name": "DEF",
"age": "12"
}
}
]}