从输入json中删除根元素的JOLT规范

ryevplcw  于 11个月前  发布在  其他
关注(0)|答案(2)|浏览(124)

输入JSON请求:

{
  "RootElement": [
    {
      "External_Contact_ID": "6504668",
      "Email_Address": "[email protected]",
      "First_Name": "Test_Name",
      "Last_Name": "TestLastName",
      "Member_STATUS": "ACTIVE"
    },
    {
      "External_Contact_ID": "6506709",
      "Email_Address": "[email protected]",
      "First_Name": "Test_Name1",
      "Last_Name": "TestLastName1",
      "Member_STATUS": "ACTIVE"
    }
  ]
}

字符串
我想从输入JSON中删除根元素,并将其转换为以下格式:

[
  {
    "External_Contact_ID": "6504668",
    "Email_Address": "[email protected]",
    "First_Name": "Test_Name",
    "Last_Name": "TestLastName",
    "Member_STATUS": "ACTIVE"
  },
  {
    "External_Contact_ID": "6506709",
    "Email_Address": "[email protected]",
    "First_Name": "Test_Name1",
    "Last_Name": "TestLastName1",
    "Member_STATUS": "ACTIVE"
  }
]


你能帮我看看JOLT的规格吗?

zd287kbt

zd287kbt1#

您可以使用下面的震动规格。

[
  {
    "operation": "shift",
    "spec": {
      "RootElement": {
        "*": "[]"
      }
    }
  }
]

字符串

rkkpypqq

rkkpypqq2#

您可以很快应用以下移位变换:

[
  {
    "operation": "shift",
    "spec": {
      "*": "" // the asterisk stands for the "RootElement"
    }
  }
]

字符串

相关问题