-
Notifications
You must be signed in to change notification settings - Fork 119
Closed
Description
Given the following configuration:
"FeatureManagement": {
"Feature1": true,
"Prefix:Feature2": true
}Querying the features was a bit surprising at first:
featureManager.IsEnabledAsync("Feature1") //returns true
featureManager.IsEnabledAsync("Prefix:Feature2") //returns falseListing the feature names is also quite misleading:
featureManager.GetFeatureNamesAsync(); //returns "Feature1", "Prefix"By taking a closer look, the colon is of course not only a gimmick, but more like a common separator for config sections. So when using the JSON file provider, the abovementioned configuration could also be semantically identical rephrased as
"FeatureManagement": {
"Feature1": true,
"Prefix": {
"Feature2": true
}
}And that explains the weird behavior.
To solve that, would it be a possible to tokenize given feature names by : , treating them as config-sections and only the last segment as the name? Imho that would fix the "Prefix":Feature" : true case, as well as enable feature grouping (see above).
cwe1ss
Metadata
Metadata
Assignees
Labels
No labels