I'd like to keep only a some part of the JSON by using jsonpath.
Let's assume I have to the following JSON:
{ "loginId":"bootstrap",
"isTechnicalUser":false,
"name":{ "+
"title":"Mr.",
"firstName":"Boot",
"familyName":"Strap""+
},
}
I want a JSON containing only $.loginId and $.name.firstName.
How can I do that with jsonpath? Or achieve that with other framework?
Thanks!
////////////// UPDATE //////////////
Forgot to mention that the configuration has to be dynamic done by the user so I cannot hard code anything (i.e. using Transient or similar)
////////////// UPDATE 2 //////////////
Perhaps it could work that first delete the nodes with jsonpath
and find the differences between this map and the original one. However I cannot find a deep map compare tool. I checked guava's but it is not good enough.