I'm getting to grips with GSON for JAVA and have a question about how to make jsonpath like selections from the large json documents I'm working with.
For example with a json document like:
{
"environment": {
"red": {
"area": {
"1": {
"name": "foo"
},
"2": {
"name": "bar"
}
}
}
}
}
The jsonpath expression of:
$.environment.red.area
Returns:
[
{
"1": {
"name": "foo"
},
"2": {
"name": "bar"
}
}
]
How can this selection be achieved in GSON?
The answer given to the question for which this question is flagged as a duplicate is not clear to me. It seems to say that it CAN be done in GSON but does not say or show how (as far as I can tell).