Open
Description
For JSON Schema, I'm exploring Spectral which uses JSON Path to identify nodes that need rules applied to them.
I'm having trouble isolating the root object when type
is object
.
For example:
{
"type": "object",
"properties": {
"bar": {
"type": "object",
"minimum": 5
}
},
"minimum": 5
}
For this data, the path $..[?(@.type=='object')]
returns only the node at /properties/bar
. However, I want to also return the root object since it also contains type: object
.
I don't think we have support for this, and it seems pretty crucial.