I have a json string eg.
{ "value": "{\"userSuspended\":false}" }
What would be the correct Jolt spec to map 'userSuspended' to 'state'?
It needed two transforms and a Javaclass to map the key/value:
One way of doing it is to split the value and save what you wanted to state.
[
{
"operation": "modify-overwrite-beta",
"spec": {
"stateArray": "=split('\"',@(1,value))"
}
},
{
"operation": "shift",
"spec": {
"stateArray": {
"1": "state"
}
}
}
]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.