feat(sdk): add variant to the /identities response flag schema#7713
Draft
gagantrivedi wants to merge 1 commit into
Draft
feat(sdk): add variant to the /identities response flag schema#7713gagantrivedi wants to merge 1 commit into
gagantrivedi wants to merge 1 commit into
Conversation
Propose an optional, nullable `variant` on each flag in the /api/v1/identities/ response: a stable identifier of the multivariate variant selected for the identity, named after OpenFeature's ResolutionDetails.variant. Schema-only change to gather feedback on the remote evaluation contract; no behaviour change.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
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. (the SDK API reference regenerates from this spec once the contract is agreed and implemented.)Changes
Contributes to the multivariate variant key work (#7698, #7699, #7704).
Adds an optional, nullable
variantto each flag in the/api/v1/identities/response (V1IdentitiesResponseV1Flag), as a sibling offeature_state_value:{ "feature": { "id": 42, "name": "checkout_button", "type": "MULTIVARIATE" }, "enabled": true, "feature_state_value": "blue", "variant": "control" }Design points for feedback:
feature_state_value: it's a per-identity evaluation result, like the value itself. Not infeature(static definition) and not in the multivariate config array (that lists all variants, not the winner).variant, matching the evaluation result contract in feat(sdk): add variant key to evaluation schemas #7704 and OpenFeature'sResolutionDetails.variant, so one term is used everywhere SDK-facing.null, not omitted —nullwhen no variant was selected or the selected variant has no key, which is DRF-idiomatic and keeps the response shape stable./identities/only —/flags/has no identity, so no percentage split ever happens thereNot in scope (follow-ups once the contract is agreed): the serialiser change in core API, Edge API parity (it serves the same contract and must match before SDKs rely on the field), and
make generate-sdk-api-docs.How did you test this code?
Schema-only change, no behaviour to test: the file validates as YAML, and the new property follows the existing
anyOf/nullable conventions used byfeature_state_valueandtrait_valuein the same document.