Skip to content

Add test case for JSON flag with null variant value - #143

Open
leoromanovsky wants to merge 1 commit into
mainfrom
lr/json-null-variant-test
Open

Add test case for JSON flag with null variant value#143
leoromanovsky wants to merge 1 commit into
mainfrom
lr/json-null-variant-test

Conversation

@leoromanovsky

Copy link
Copy Markdown
Member

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.

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>
Comment thread ufc/flags-v1.json
Comment on lines +3410 to +3420
"shards": [
{
"salt": "null-test-salt",
"ranges": [
{
"start": 0,
"end": 10000
}
]
}
]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no-op shard

Suggested change
"shards": [
{
"salt": "null-test-salt",
"ranges": [
{
"start": 0,
"end": 10000
}
]
}
]
"shards": []

Comment thread ufc/flags-v1.json
Comment on lines +3394 to +3406
"rules": [
{
"conditions": [
{
"attribute": "test_group",
"operator": "ONE_OF",
"value": [
"null_variant"
]
}
]
}
],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
leoromanovsky marked this pull request as ready for review November 6, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants