Re-parent a JSON object using Jolt

扶醉桌前 提交于 2019-12-02 09:17:25

Spec

[
  {
    "operation": "shift",
    "spec": {
      "@": "NEWPARENT"
    }
  }
]

FYI, the "root" you are seeing is an artifact of the way that Jolt deals with the fact that the top level JSON input can be either a List or a Map, and that you want to be able to Transform a List into a Map (and vice versa).

So, jolt "wraps" the input so that it is "always" transforming a Map that has a single key "root", with a value that is the input.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!