feat(sdk): make evaluation result variant required and nullable#7726
Merged
Conversation
Follow-up to #7704. The flag engine and SDKs always populate `variant` (the variant's key, "control" for the control bucket, or null when no multivariate split applied), mirroring OpenFeature's always-present, nullable ResolutionDetails.variant. Make the schema match: `variant` becomes required with type [string, null].
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
This was referenced Jun 8, 2026
Contributor
Docker builds report
|
Zaimwa9
approved these changes
Jun 8, 2026
Contributor
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Contributor
Visual Regression19 screenshots compared. See report for details. |
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.
docs/if required so people know about the feature. (SDK-facing docs land with the SDK slice.)Changes
#7704 added
varianttoFlagResultas an optional string. Since then we settled on the OpenFeature-faithful shape:variantis always present, nullable — matchingResolutionDetails.variant(str | None), which is always a field on the details object.This makes the schema match the engine/corpus:
FlagResult.variantbecomes required.["string", "null"].Semantics: the variant's key when a named multivariate variant is selected,
"control"when the identity falls in the control bucket, ornullwhen no multivariate split applied (a standard feature, an unkeyed variant, or evaluation without an identity).FeatureValue.keyin the context schema (the input) stays optional — only the outputvariantis always-present.How did you test this code?
datamodel-code-generator0.33.0 against the updated schema emitsvariant: Optional[str](a required, nullable key), which matches the hand-updatedflag_engine/result/types.pyin feat: include selected variant key in flag results flagsmith-engine#314.varianton every flag result.