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

select_jsonpath fails on missing json keys #232

Closed
kroepke opened this issue Dec 7, 2017 · 0 comments
Closed

select_jsonpath fails on missing json keys #232

kroepke opened this issue Dec 7, 2017 · 0 comments
Assignees
Labels
bug
Milestone

Comments

@kroepke
Copy link
Member

@kroepke kroepke commented Dec 7, 2017

When using select_jsonpath to extract one or more values from a JSON object, the function does not handle missing values gracefully and will fail the entire rule.

The test introduced in #209 unfortunately looks like it tests for the correct behavior, but the test harness is not exactly the same as the production code.

Thus we need to filter out null values in the function itself. The NPE is an unfortunate sideeffect of the Java streams map collector, rather than the overall "null-ness" of a value in a map.

@kroepke kroepke added the bug label Dec 7, 2017
@kroepke kroepke added this to the 2.4.0 milestone Dec 7, 2017
@kroepke kroepke self-assigned this Dec 7, 2017
kroepke added a commit that referenced this issue Dec 7, 2017
@ghost ghost added the in progress label Dec 7, 2017
@joschi joschi closed this in #233 Dec 7, 2017
joschi added a commit that referenced this issue Dec 7, 2017
@ghost ghost removed the in progress label Dec 7, 2017
joschi pushed a commit that referenced this issue Dec 7, 2017
Fixes #232

(cherry picked from commit ecc33b8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant