[英]Conversion of string to array in jolt transformation
我有這樣的輸入 json :
輸入:
{
"userstatus": {
"authtype": "S,R,T",
}
}
在這里,我需要更改密鑰 - authtype 並將這些值放入數組中。
預期 Json:
{
"userstatus": {
"authtype": ["S","R","T"]
}
}
但實際的 Output 我得到了這樣的:
{
"authtype" : [ "S,R,T" ]
}
顛簸規格:
[
{
"operation": "shift",
"spec": {
"userstatus": {
"authtype": "authtype.[]"
}
}
}
]
請幫我解決上述測試用例?
這是你的規格。 您應該在修改操作中使用拆分 function。
[
{
"operation": "modify-overwrite-beta",
"spec": {
"userstatus": {
"authtype": "=split(',',@(1,authtype))"
}
}
}
]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.