Open candicerimba opened 10 months ago
There is no such function at the moment, no.
How are you proposing that it would work? What is the argument to the function?
What would you use it for?
I don't think we'd be able to implement it as a function? It feels like it'd require something deeper in the code, kind of how we access .field
, we'd be tracking the parent .field
s traversed up until that point. I haven't read JSLT code at all, so this might be wholly impossible to do.
We're currently using JSLT to detect certain fields / data, but the action we need to take doesn't happen with JSLT, so we'd ideally want to return a path / pointer to that entry for easy access.
Yes, it looks awkward to do as a function. One problem is that Jackson's JsonNode
doesn't have any way to get the parent of the node, so taking a value and returning a JSLT expression to produce is not straightforward.
It probably is possible to extend the JSLT implementation to track the path taken down to the current value, by creating an ExecutionContext
or something like that. It might not always yield correct results, however, and there would be a performance penalty to be paid by all JSLT users.
Is there a function we could use to access the complete path / pointer in a current context?