Reputation: 31
I have a json string e.g..
{ "value": "{\"userSuspended\":false}" }
What would be the correct Jolt spec to map 'userSuspended' to 'state'?
Upvotes: 2
Views: 1258
Reputation: 31
It needed two transforms and a Javaclass to map the key/value:
Upvotes: 1
Reputation: 161
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"
}
}
}
]
Upvotes: 0