@@ -16,6 +16,16 @@ namespace Flagsmith
1616 /// </summary>
1717 public static class Mappers
1818 {
19+ /// <summary>
20+ /// Property value for operators that do not use property (e.g., PERCENTAGE_SPLIT).
21+ /// </summary>
22+ private const string EmptyProperty = "" ;
23+
24+ /// <summary>
25+ /// Key value for synthetic segments and identity override features.
26+ /// </summary>
27+ private const string UnusedKey = "" ;
28+
1929 /// <summary>
2030 /// Parse the environment document into an EvaluationContext object
2131 /// </summary>
@@ -96,7 +106,7 @@ private static SegmentRule[] MapEnvironmentDocumentRulesToContextRules(List<Segm
96106 Conditions = ( srcRule . Conditions ?? Enumerable . Empty < SegmentConditionModel > ( ) )
97107 . Select ( c => new Condition
98108 {
99- Property = c . Property ?? "" ,
109+ Property = c . Property ?? EmptyProperty ,
100110 Operator = MapOperator ( c . Operator ) ,
101111 Value = MapConditionValue ( c . Value ) ,
102112 } )
@@ -199,7 +209,7 @@ private static Dictionary<string, SegmentContext<SegmentMetadata, FeatureMetadat
199209
200210 var segment = new SegmentContext < SegmentMetadata , FeatureMetadata >
201211 {
202- Key = "" , // Not used in identity overrides
212+ Key = UnusedKey ,
203213 Name = "identity_overrides" ,
204214 Metadata = new SegmentMetadata
205215 {
@@ -228,7 +238,7 @@ private static Dictionary<string, SegmentContext<SegmentMetadata, FeatureMetadat
228238
229239 segment . Overrides = overridesKey . Select ( overrideKey => new FeatureContext < FeatureMetadata >
230240 {
231- Key = "" , // Not used in identity overrides
241+ Key = UnusedKey ,
232242 Name = overrideKey . Name ,
233243 Enabled = overrideKey . Enabled ,
234244 Value = overrideKey . Value ,
0 commit comments