I need to create similar JSON file structure to the following post but its need to be dynamic, when I search I found the following post but the solution is specific for entry 1 and entry2 my needs is that the structure of the json will be exactly the same but can get any name of entity i.e. instead of entry the entity name could be customer,address ,sales order etc and then array with fields like key value .In the post the fields are hard-coded in the POJO'S but I need to provide ability to add any field to the entry ...there is a way to provide dynamic solution?
Thanks!
Create JSON file with deep array
{
"customer": [
{
"id": "0001",
"type": "USER",
"f1": "USER",
"f2": "USER1",
....
},
{
"id": "0002",
"type": "EMP",
"property":"Salery",
"f5": "USER",
"f6": "USER1",
....
}
],
"Address": [
{
"id": "0005",
"name": "Vacation",
"property":"user",
},
{
"id": "0008",
"name": "Work",
"f5": "USER",
"f6": "USER1",
....
}
]
}