【发布时间】:2021-02-24 17:28:07
【问题描述】:
我有三个场景:
场景 1: 当 "testInt" == 10 时,"isTrue" 应设置为 false,"testInt" 应设置为 0 和 "testString"。
输入
{
"testString" :"testValue",
"testInt": 10,
"isTrue": true
}
预期输出
{
"testString" :"testValue",
"testInt": 0,
"isTrue": false
}
场景 2: 当 "testInt" == null 时,"testInt" 应该被删除,其他的则保持原样。
输入
{
"testString" :"testValue",
"testInt": null,
"isTrue": true
}
预期输出
{
"testString" :"testValue",
"isTrue": true
}
场景 3: 当"testInt" != 10(也是not null)时,没有变化。
输入
{
"testString" :"testValue",
"testInt": 20,
"isTrue": true
}
预期输出
{
"testString" :"testValue",
"testInt": 20,
"isTrue": true
}
如果有人建议我如何通过 jolt shift 操作来实现这些,那将会很有帮助。
【问题讨论】:
标签: json transformation jolt