-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contribute all leafs in node, if node is selected by expression #7
Comments
Hi, having a closer look at this, it is not as straightforward as I thought initially. Will tinker a bit to see if it's possible to come with something not too obscure. br, |
Perhaps if a node is found from a JSONPath or XPath then all leafs in the node can be contributed in variables like:
Also perhaps any child nodes should be contributed as well. There can even be an option to contribute everything without having to add a JSONPath or XPath. |
Hi Tomas, I think I'll be able to have a PR for this issue by tomorrow; I've already made the appropiate changes with their corresponding unit tests, but would like to test it on a live installation first to ensure evertyhing is fine. br, |
fixes #7: Contribute all leafs in node, if node is selected by expression
I released this in 1.11 now! |
Cool, thanks! :-) |
Hi,
Currently, if a JSONPath expression selects a node rather than a leaf, then no matter what, it gets converted to a String. This is because on
VariableResolver#addPostContentParameters
, the call to thefilter
methods uses atoString
on the resolved variable (which, in JSONPath can also be a map, if the expression resolves to a node instead of a leaf)For large pipelines, which use a lot of JSONPath params, it would be nice to have one or two variables representing JSONPath nodes, instead of having one variable for each needed value (as a side effect, this would also allow to access the whole webhook payload). F.ex, inside the pipeline is really easy to do something like
and it's much more manageable if the job has only one or a couple of JSONPath params rather than 10 or 12.
It seems that to achieve this only requires a couple of changes on
VariableResolver
:filter
should be changed to:filter
method with:As noted above, the ability to filter values on the parameter would be lost for nodes, although that functionality wouldn't be really useful for them anyway.
WDYT?
thanks,
juan pablo
The text was updated successfully, but these errors were encountered: