I want to transform this:
{
"key": "MyNamespace.myName",
"value": true
}
to
{
"data": {
"header": {
"namespace": "MyNamespace",
"name": "SetMyName",
"messageId": "UUIDString"
},
"payload": {
"myName": true
}
}
}
A couple of questions here. First, I'm not sure how to split the json value of key
, MyNamespace.myName
, into two parts, which will be assigned as values of the keys namespace
and name
, respectively, as part of the shift
operation.
Second, I need to transform the case of myName
by capitalizing the first letter of the name, so it becomes MyName
, before appending it to Set
.
What's the best way to do this?