In a legacy system I found this JSONPath :
$['data']..['rels'][?]['persons'][*]
I am confused by [?]
,
as I am trying to rebuild the expected JSON that should by like (but it's not) :
{
"tag1": ["VALUE1"],
"data": [
{
"tag2": "VALUE2",
"rels": [
{
"persons": [
{
"uid": "uid12"
}
],
"tag3": {
"tag4": "tag4"
}
}
]
}
]
}
I used https://jsonpath.com/
Thanks for your help
You're right to be confused by this. It's not valid JSON Path syntax. It's an extension syntax supported by Jayway JsonPath (a JavaScript implementation) that they call "Filter Predicates." You can read about it in the project's readme.
I and a few others have been working on writing an official specification for JSON Path, and I brought this up recently after having seen another question around it. This kind of confusion is something we aim to avoid.