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.
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.