小编Khu*_*pov的帖子

Jolt 变换 json - 如何添加默认字段

我有以下输入JSON

{
  "id": "2ef8a2ee-054f-4b43-956a-8aa4f51a41d5",
  "type": "VOICE",
  "tags": [
    {
      "id": "some id 1",
      "description": "some description 1"
    },
    {
      "id": "some id 2",
      "description": "some description 2"
    }
  ],
  "transcription": {
    "key1": "val1",
    "key2": "val2"
  }
}
Run Code Online (Sandbox Code Playgroud)

但是,输出JSON应该类似,并且仅添加默认值:

{
  "id": "2ef8a2ee-054f-4b43-956a-8aa4f51a41d5",
  "created": "2019-06-18T18:12:37",
  "firstName": "Khusan",
  "lastName": "Sharipov",
  "status": "OPEN"
  "type": "VOICE",
  "tags": [
    {
      "id": "some id 1",
      "description": "some description 1"
    },
    {
      "id": "some id 2",
      "description": "some description 2"
    }
  ],
  "transcription": { …
Run Code Online (Sandbox Code Playgroud)

json transformation default-value jolt apache-nifi

6
推荐指数
1
解决办法
8320
查看次数

标签 统计

apache-nifi ×1

default-value ×1

jolt ×1

json ×1

transformation ×1