I am working on JOLT library to perform a change to the json values.
For key-value items I found a solution using
"operation": "modify-overwrite-beta"
But when it comes to edit values inside the arrays I encounter problems.
Let's have for example this JSON:
{
"parentModule": [
{
"childModule": {
"arrayModule": [
"KK",
"VV"
]
}
}
]
}
SPEC I am using
[
{
"operation": "modify-overwrite-beta",
"spec": {
"parentModule": {
"*": {
"childModule": {
"arrayModule": [
"TT",
"RR"
]
}
}
}
}
}
]
The result I want is that the array is totally override , but currently it is replacing only the first value.
Result expected:
{
"parentModule": [
{
"childModule": {
"arrayModule": [
"TT",
"RR"
]
}
}
]
}
Is there any way to:
- completely override the array?
- change values conditionally, for example if TT => change to AB, else if RR than write BB ?
Thanks