LT-1633 fixed incorrect JSON logic behaviour for null var values#1
Closed
andras-markos wants to merge 24 commits intomasterfrom
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 <rickard.katz@tactel-ext.se> Co-authored-by: Sam Jesso <samuel.jesso@gmail.com>
…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:
|
Author
I split this PR into more smaller PRs. |
Author
|
Deleted the feature branch as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes an issue in the JSONLogic Java implementation where
nullvalues 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
nulland missing values in JSONLogic evaluation.Review Notes