JSON输入:
[
{
"Rating": 1,
"SecondaryRatings": {
"Design": 4,
"Price": 2,
"RatingDimension3": 1
}
},
{
"Rating": 1,
"SecondaryRatings": {
"Design": 4,
"Price": 2,
"RatingDimension3": 1
}
}
]
JOLT规范:
[
{
"operation": "shift",
"spec": {
"*": {
"Rating": "[&1].rating-primary",
"SecondaryRatings": {
"*": "rating-&"
}
}
}
}
]
当前输出:
[ {
"rating-primary" : 1
}, {
"rating-primary" : 1
} ]
预期输出:
[ {
"rating-primary" : 1
"rating-Design" : 4,
"rating-Price" : 2,
"rating-RatingDimension3" : 1
}, {
"rating-primary" : 1
"rating-Design" : 4,
"rating-Price" : 2,
"rating-RatingDimension3" : 1
} ]
答案 0 :(得分:0)
规格
[
{
"operation": "shift",
"spec": {
"*": {
"Rating": "[&1].rating-primary",
"SecondaryRatings": {
"*": "[&2].rating-&"
}
}
}
}
]