我目前有一个通过Mapper snap.json
路由的传入文件。在那个映射器快照中,我需要获取一个名称数组,等等,并将字符串添加到它们中的每一个。这些名称在模式中的路径是:bob.jones
eric.smith
@email.com
jsonPath($, "$response.entity[*].target.name")
结构如下所示:
{
"entity": [
{
"target": {
"name": "bob.jones"
}
},
{
"target": {
"name": "eric.smith"
}
},
...
]
}
只需映射路径jsonPath($, "$response.entity[*].target.name")
将传递名称和输出bob.jones
和eric.smith
. 我尝试.concat()
在数组上使用,但所做的只是添加@email.com
到列表中,所以我得到了bob.jones, eric.smith, @email.com
. 我试图找出一个可以编辑数组项而不改变其结构的表达式。