I'm trying to modify this JSON to remove key values except "url" from an array object of attachment.
Json Path version I'm using: 2.7.0
{
"fields": {
"item_name": "mypass\n",
"id": "nopass cell",
"Attachment": [
{
"id": "attaMKW4RR5misdsD",
"url": "https://url1.com",
"filename": "test-nopass.txt",
"size": 17,
"type": "text/plain"
},
{
"id": "attHy3s6MBzce7Qoq",
"url": "https://url2.com",
"filename": "test-mypass.txt",
"size": 28,
"type": "text/plain"
},
{
"id": "atth4oFqzanlk9532",
"url": "https://url3.com",
"filename": "test- yourpass .txt",
"size": 28,
"type": "text/plain"
}
]
}
}
here I want to modify this json object to the below code.
{
"fields": {
"item_name": "mypass\n",
"id": "nopass cell",
"Attachment": [
{
"url": "https://url1.com",
},
{
"url": "https://url2.com",
},
{
"url": "https://url3.com",
}
]
}
}
so how can I achieve this from Jayway JsonPath expression?