我是scala / play的新手,我一直在尝试更新JSON query
中的sections[1]
数组(向其中添加新ID),但是我无法成功遍历JSON我对变压器及其使用方法一无所知。
"definitions": [
{
"sections": [
{
"priority": 1,
"content": {
"title": "Driver",
"links": [
{
"url": "https://blabla.com",
"text": "See all"
}
]
},
"SearchQuery": {
"options": {
"aggregate": true,
"size": 20,
},
"query": "{\"id\":{\"include\":[\"0wxZ4Nr2\", \"0wxZbNr2\", \"6WZOPMw1\"}}"
}
},
{
"priority": 2,
"content": {
"title": "Deliver",
"links": [
{
"url": "https://blabla.com",
"text": "See all"
}
]
},
"SearchQuery": {
"options": {
"aggregate": true,
"size": 20,
},
"query": "{\"id\":{\"include\":[\"2W12Q2wq\", \"Nwq09lW3\", \"QweNN2d9\"]}}"
}
}
]
}
关于如何实现此目标的任何建议。我的目标是将值放在JSON数组的特定字段内。我在整个应用程序中都使用play JSON库吗?
您注意到,如果您使用PlayJSON,则可以使用Json Transformers