Reputation: 157
Given the following input JSON:
{
"a": 1,
"b": "some root string",
"c":
{
"d": "some inner string"
}
"e": "ignored field"
}
Is it possible to obtain the following JSON using a JSONPath expression?
{
"a": 1,
"b": "some root string",
"d": "some inner string"
}
Thank you in advance.
Upvotes: 3
Views: 6451
Reputation: 2280
Below JsonPath should give you the expected output. However it depends on the type of Implementation.
$..['a','b','d']
JSONPath Evaluator : https://jsonpath.herokuapp.com/
You need to set the option Return null for missing leaf
It returns all the values without having to select any options.
Upvotes: 2