How to convert linkedHashMap to list / json object
Hi Team,
I have an input json in linkedHashMap in below format:
[
{
“Path”: “/OrgName/shared”,
“subject_type”: [
“GROUP”,
“GROUP”,
“GROUP”,
“USER”
],
“subject”: [
“Operations”,
“admins”,
“Architects”,
“xyz@xyz.com”
],
“perms”: [
[
“R”,
“X”,
“W”
],
[
“R”,
“X”
],
[
“R”,
“X”
],
[
“R”,
“X”
]
]
},
{
“Path”: “/OrgName/shared2”,
“subject_type”: [
“GROUP”,
“GROUP”,
“GROUP”,
“USER”
],
“subject”: [
“Operations”,
“admins”,
“Architects”,
“abc@abc.com”
],
“perms”: [
[
“R”,
“X”,
“W”
],
[
“R”,
“X”
],
[
“R”,
“X”
],
[
“R”,
“X”
]
]
}
]
My requirement is to map the respective fields and need them in a file as below:
{
{ “Path”: “/OrgName/shared”,
“subject_type”:“GROUP”,
“subject”:“Operations”
“perms”: [
“R”,
“X”,
“W”
]
},
{ “Path”: “/OrgName/shared”,
“subject_type”:“GROUP”,
“subject”:“admins”
“perms”:
[
“R”,
“X”
]
},
{ "Path": "/OrgName/shared",
"subject_type":"GROUP",
"subject":"Architects"
"perms":
[
"R",
"X"
]
},
{ "Path": "/OrgName/shared",
"subject_type":"user",
"subject":"xyz@xyz.com"
"perms":
[
"R",
"X"
]
}
}
can it be achieved using any inbuilt snaps or should we go for a script? Any script snippets is appreciated.
Regards,
Satya
Hi Satya,
Please find the attached pipeline for the solution.
Regards,
Anil