Jolt:在子对象中添加键

Jolt : Add key in sub object

输入

{
    "id": 1,
    "name": "Sample name",
    "attributes": {
        "age": 10
    }
}

输出

{
    "id": 1,
    "attributes": {
        "name": "Sample name",
        "age": 10
    }
}

我想进行这个改造。我尝试了以下规格

[
  {
    "operation": "shift",
    "spec": {
      "*": "&",
      "name": "attributes.&"
    }
  }
]

但这会将 attributes 字段更改为数组。此处使用的正确规范应该是什么?

以下规范可行

[
  {
    "operation": "shift",
    "spec": {
      "*": "&",
      "name": "attributes.&",
      "attributes": {
        "*": "attributes.&"
      }
    }
  }
]