From 5387a94d37868daf8464ac800a4208cf3dc09a1a Mon Sep 17 00:00:00 2001 From: Gagan Trivedi Date: Thu, 4 Jun 2026 14:22:55 +0530 Subject: [PATCH] feat(sdk): add variant key to evaluation schemas Add an optional `key` to FeatureValue in the evaluation context schema, and an optional `variant` to FlagResult in the evaluation result schema, so engines can report which multivariate variant was selected. The `variant` name follows OpenFeature's ResolutionDetails.variant. Both fields are omitted when not applicable, consistent with the existing optional fields in these schemas. --- sdk/evaluation-context.json | 5 +++++ sdk/evaluation-result.json | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/sdk/evaluation-context.json b/sdk/evaluation-context.json index fb42a67ed7af..0af18329fd3b 100644 --- a/sdk/evaluation-context.json +++ b/sdk/evaluation-context.json @@ -82,6 +82,11 @@ "FeatureValue": { "description": "Represents a multivariate value for a feature flag.", "properties": { + "key": { + "description": "A stable, human-readable identifier for the variant. Omitted when the variant has no key set.", + "title": "Key", + "type": "string" + }, "value": { "description": "The value of the feature.", "title": "Value", diff --git a/sdk/evaluation-result.json b/sdk/evaluation-result.json index 1101339f6c39..5afd5c5aa12f 100644 --- a/sdk/evaluation-result.json +++ b/sdk/evaluation-result.json @@ -27,6 +27,11 @@ "title": "Reason", "type": "string" }, + "variant": { + "description": "A stable identifier of the selected multivariate variant. Omitted when no variant was selected, or when the selected variant has no key set.", + "title": "Variant", + "type": "string" + }, "metadata": { "existingJavaType": "java.util.Map", "description": "Additional metadata associated with the feature.",