I'm trying to make something like an attribute selection mechanism.
what I'm trying to make is to send query prams to select with attributes to be returned from the API.
for example
JSON
{
"id": 10,
"name": "test1",
"featues": [
{
"id": "1",
"name": "age",
"value": {
"type": "num",
"value": 12
}
},
{
"id": "2",
"name": "age",
"value": {
"type": "num",
"value": 12
}
}
]
}
URL
url/resource?fields=$.featues[*].id
Current result
[
"1",
"2"
]
it extracted the value, I don't want that behavior, I want to keep the path to the value
what the behavior I want is
{
"featues": [
{
"id": "1"
},
{
"id": "2"
}
]
}
any suggestions?