-
Notifications
You must be signed in to change notification settings - Fork 1
LT-1633 fixed incorrect JSON logic behaviour for null var values #1
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
Conversation
`in` of strings would fail with NullPointerException if the first argument was `null`. Also add some tests with null in various places.
When missing_some is applied to a `null` data object, it would return all its arguments, including the threshold. According to the spec, it should return an array of the missing keys. Also, if the threshold is 0, it should always return an empty list, even when data is `null`.
Fix bug in missing_some
…ring Avoid NullPointerException if first argument to "in" is null
…f_operations Removed the redundant storage of operations
* Initial commit for Github actions * Make uploadArchives conditional on the presence of Sonatype credentials * Turn off signing conditionally * Really make signing optional * Add testing output * Test publish step * Attempt to fix path for upload-artifacts action * Use v4 for upload/download-artifacts * Fix signing logic to use in memory keys * Fix push logic in the bump version step * Use checkout@v4 * Add a rebase before committing * Hard-code branch name... * Prepare version 1.0.9-SNAPSHOT for development [skip ci] * Prepare for merge * Remove .vscode folder * Add .vscode to the .gitignore * Split into multiple files * Prepare version 1.0.9-SNAPSHOT for development [skip ci] * Clean up TODOs --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Run publish action when a merge is performed on the main branch (is this really how you do it? yuck...) * Github actions fix
…alid array" (jamsesso#42) Added tests for different "all in" cases. Co-authored-by: Rickard Katz <[email protected]> Co-authored-by: Sam Jesso <[email protected]>
…so#53) * Adds jsonPath to error messages, so errors can be pinpointed. The jsonPath can be used to provide better error messages to users trying to create valid jsonLogic expressions Also: Fixes some exception messages to use the right operator. ("none", "or"). Aligns behavior to reference implementation for sums of unparseable strings, as well as for between comparisons of > and >=, and for comparison operators with arrays of more than three values. * Handles edge cases of + and * the way jsonlogic.com does When presented with an array parameter, jsonlogic.com uses the first value for + and * expressions. * Uses fixtures for the error tests. Also fixes a bug in the jsonPath calculation for and/or. * Bump version to 1.1.0-SNAPSHOT
…y treated as missing
…emoved unnecessary blank line, removed unnecessary braces, simplified return expression, added hashCode method to make checkstyle pass
@andras-markos I think we're trying to do too much at once here, witness the fact that the build fails. I know they're separate commits but I'm having a hard time figuring out what you changed even there. This thing is still running github actions. I'd recommend the following sequence:
|
I split this PR into more smaller PRs. |
Deleted the feature branch as well. |
Summary
This PR fixes an issue in the JSONLogic Java implementation where
null
values are incorrectly treated as missing (not present) instead of present but empty. This behavior can cause LO flows to trigger incorrectly.For full background, see the JSONLogic Java library wiki page.
Changes in this PR
null
and missing values in JSONLogic evaluation.Review Notes