Skip to content
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

Issue with WildCard in jsonPath after #786 #1010

Open
suhailSj opened this issue May 22, 2024 · 0 comments
Open

Issue with WildCard in jsonPath after #786 #1010

suhailSj opened this issue May 22, 2024 · 0 comments

Comments

@suhailSj
Copy link

suhailSj commented May 22, 2024

we have a use case where we are doing documentContext.read("$.max($.req._event.interpretations[*].nluConfidence)", String.class)

for the first invocation this is passing.
as for the first invocation there is no value in the LRU cache and new object of JsonPath is created and added in the cache. continuing the first invocation after the new JsonPath is added in cache we are performing multiple operations such as
https://github.com/json-path/JsonPath/blame/8a0d2fd594b4a1baab71132cf5ef74889b9976e5/json-path/src/main/java/com/jayway/jsonpath/internal/path/FunctionPathToken.java#L43

which is leading to deletion of [*] from the Path inside the map, and hence for subsequent calls json path is evaluated on "$.max($.req._event.interpretations.nluConfidence)" which gives Aggregation function attempted to calculate value using empty array because the evaluation criteria has changed.

when we stored in he LRU cache the value of path was $['req']['_event']['interpretations'][*]['nluConfidence'] which was running the max function on array. but after cleanWildcardPathToken(); the value is changed to below image

Screenshot 2024-05-22 at 4 26 03 PM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant