Add test case for JSON flag with null variant value - #143
Open
leoromanovsky wants to merge 1 commit into
Open
Conversation
This test demonstrates that null is a valid JSON value that should be returned by SDKs when a JSON flag variation is explicitly set to null. This addresses the issue where checking `if (variant != null)` might incorrectly skip returning null values when null is a legitimate JSON response. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
5 tasks
dd-oleksii
approved these changes
Nov 6, 2025
Comment on lines
+3410
to
+3420
| "shards": [ | ||
| { | ||
| "salt": "null-test-salt", | ||
| "ranges": [ | ||
| { | ||
| "start": 0, | ||
| "end": 10000 | ||
| } | ||
| ] | ||
| } | ||
| ] |
Collaborator
There was a problem hiding this comment.
nit: no-op shard
Suggested change
| "shards": [ | |
| { | |
| "salt": "null-test-salt", | |
| "ranges": [ | |
| { | |
| "start": 0, | |
| "end": 10000 | |
| } | |
| ] | |
| } | |
| ] | |
| "shards": [] |
Comment on lines
+3394
to
+3406
| "rules": [ | ||
| { | ||
| "conditions": [ | ||
| { | ||
| "attribute": "test_group", | ||
| "operator": "ONE_OF", | ||
| "value": [ | ||
| "null_variant" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ], |
Collaborator
There was a problem hiding this comment.
nit: we don't really test targeting here, so we can simplify:
Suggested change
| "rules": [ | |
| { | |
| "conditions": [ | |
| { | |
| "attribute": "test_group", | |
| "operator": "ONE_OF", | |
| "value": [ | |
| "null_variant" | |
| ] | |
| } | |
| ] | |
| } | |
| ], | |
| "rules": [], |
leoromanovsky
marked this pull request as ready for review
November 6, 2025 15:14
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.
This test demonstrates that null is a valid JSON value that should be returned by SDKs when a JSON flag variation is explicitly set to null.
This addresses the issue where checking
if (variant != null)might incorrectly skip returning null values when null is a legitimate JSON response.