【问题标题】:Jolt Spec for populating field based on value of another field用于根据另一个字段的值填充字段的 Jolt Spec
【发布时间】:2020-02-25 08:47:15
【问题描述】:

我想使用基于另一个字段值的字段填充我的目标 JSON。

例如

Input JSON:
[

{
"examUrl": "https://exam.test.com/page/1473161074",
"urlTypeName": "Spring URL"
},

{
"examUrl": "https://exam.test.com/page/12423222",
"urlTypeName": "Java URL"
},

]

预期输出:

{

"ExamDashBoardURL" : "https://exam.test.com/page/1473161074"

}

在上面的示例中,只有当 urlTypeName 为“Spring URL”时,我才会填充 ExamDashBoardURL。

谁能帮帮我。

【问题讨论】:

    标签: jolt


    【解决方案1】:

    我找到了解决方案。它可能对某人有帮助。

    如果有人有更好的规格,请告诉我

    [
    {
    "operation": "shift",
    "spec": {
    "*": {
    "urlTypeId": {
    "1": {
    "@2": "domoDashboardLink"
    }
    }
    }
    }
    },
    {
    "operation": "shift",
    "spec": {
    "domoDashboardLink": {
    "examUrl": "&1"
    }
    }
    }
    ]```
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-06-12
      • 1970-01-01
      • 1970-01-01
      • 2010-10-06
      • 1970-01-01
      • 2022-11-26
      • 2019-06-12
      • 1970-01-01
      相关资源
      最近更新 更多