目前我有以下输入sson. 已添加"临时"-对象 在默认规范的帮助下.
{
"items": [
{
"description": "myDescription",
"attributes": [
{
"identifier": "colour",
"type": "attribute",
"values": [
"DE"
],
"hint": "1"
},
{
"identifier": "pin",
"type": "attribute",
"values": [
"4711"
],
"hint": "1"
},
{
"identifier": "price",
"type": "price",
"values": [
"77.27"
],
"hint": "1"
},
{
"identifier": "weight",
"type": "attribute",
"values": [
"0.47"
],
"hint": "1"
},
{
"identifier": "status",
"type": "attribute",
"values": [
"active"
],
"hint": "1"
}
]
}
],
"temp": {
"hint": "1",
"identifier": "additionalDescription",
"values": [
{
"lang": "de",
"value": "temp"
},
{
"lang": "en",
"value": "temp"
},
{
"lang": "fr",
"value": "temp"
},
{
"lang": "it",
"value": "temp"
},
{
"lang": "es",
"value": "temp"
}
],
"type": "attribute"
}
}
帖子主题:Re:Колибри
{
"items": [
{
"description": "myDescription",
"attributes": [
{
"identifier": "colour",
"type": "attribute",
"values": [
"DE"
],
"hint": "1"
},
{
"identifier": "pin",
"type": "attribute",
"values": [
"4711"
],
"hint": "1"
},
{
"identifier": "price",
"type": "price",
"values": [
"77.27"
],
"hint": "1"
},
{
"identifier": "weight",
"type": "attribute",
"values": [
"0.47"
],
"hint": "1"
},
{
"identifier": "status",
"type": "attribute",
"values": [
"active"
],
"hint": "1"
},
{
"hint": "1",
"identifier": "additionalDescription",
"values": [
{
"lang": "de",
"value": "myDescription"
},
{
"lang": "en",
"value": "myDescription"
},
{
"lang": "fr",
"value": "myDescription"
},
{
"lang": "it",
"value": "myDescription"
},
{
"lang": "es",
"value": "myDescription"
}
],
"type": "attribute"
}
]
}
]
}
我正在寻找的规格应该填满两个 要求:
- 将"新"对象集成到属性数组中.
- 用描述字段的值替换值"mat", 它可以在json的顶部找到.
不幸的是,我已经很难将数组正确地放入输出杨森中, 更不用说重写值"temp"
[
{
"operation": "shift",
"spec": {
"items": {
"*": {
"description": "&2.myDescription",
"attributes": {
"@(3,temp)": "&3.&2.&",
"*": "&3.&2.&"
}
}
}
}
}
]
我们非常感谢任何帮助.此外,我也很高兴收到有关第一个要求的提示.每当涉及数组时,我在构建RHS(右侧)时总是感到困难.