i'm stuck.. i want to use a data from my json, and edit this json with the same data: (images are better then explication) my JSON file looks like that:
[{
"method": "GET",
"path": "/",
"aliases": "",
"name": "rootPath",
"handler": "generatedApps/avion01/actions.HomeHandler"
},
{
"method": "GET",
"path": "/avions/",
"aliases": "",
"name": "avionsPath",
"handler": "generatedApps/avion01/actions.AvionsResource.List"
},
{
"method": "GET",
"path": "/notifications/",
"aliases": "",
"name": "notificationsPath",
"handler": "generatedApps/avion01/actions.NotificationsResource.List"
},
{
"method": "POST",
"path": "/notifications/",
"aliases": "",
"name": "notificationsPath",
"handler":
"generatedApps/avion01/actions.NotificationsResource.Create"
}]
and i want to take the param who are in "path" (avions or notification) and create a data named "ressourceName":"(if path == avions or path == notification)"
That should look like this:
[{
"method": "GET",
"path": "/",
"aliases": "",
"name": "rootPath",
"handler": "generatedApps/avion01/actions.HomeHandler"
},
{
"ressourceName": "avions",
"method": "GET",
"path": "/avions/",
"aliases": "",
"name": "avionsPath",
"handler": "generatedApps/avion01/actions.AvionsResource.List"
},
{
"ressourceName": "notifications",
"method": "GET",
"path": "/notifications/",
"aliases": "",
"name": "notificationsPath",
"handler": "generatedApps/avion01/actions.NotificationsResource.List"
},
{
"ressourceName": "notifications",
"method": "POST",
"path": "/notifications/",
"aliases": "",
"name": "notificationsPath",
"handler":
"generatedApps/avion01/actions.NotificationsResource.Create"
}]