I am using net.javacrumbs.jsonunit.assertj, JsonAssertions, assertThatJson to compare two jsons. I need to ignore node with array and sub-nodes. So in this example I would like to ignore all in node "ignoreAllIn"
{
"md": {
"i": "value1",
"z": [],
"ignoreAllIn": [
{
"t": "1",
"i": [
{
"j": 4,
"q": 13,
"v": "null"
},
{
"j": 4,
"q": 11,
"v": "null"
},
{
"j": 4,
"q": 143,
"v": "null"
}
]
}
]
}
}
I tried with wildcard *
.when(path("md.i[*]"), then(IGNORING_EXTRA_FIELDS))
.when(path("md.i[*]"), then(IGNORING_VALUES))
.when(path("md.i[*]"), then(IGNORING_EXTRA_ARRAY_ITEMS))
But I need to list all fields and the real number of nodes is too big to list.