-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature names with colon in name are not parsed correctly #90
Comments
In general, the ':' character should be avoided in setting names in json settings files in .NET Core. The ':' character is treated specially as you have called out. I don't think it would be a good idea to go against that concept. It may be a good idea to call this out in the readme though. |
Well, since |
That's a great suggestion. Technically if someone is using a custom |
I just tried Azure App Configuration and was surprised by this behavior as well. The docs use a colon for regular key/value pairs and this works as expected with ASP.NET Core ( https://learn.microsoft.com/en-us/azure/azure-app-configuration/quickstart-aspnet-core-app?tabs=core6x#create-an-app-configuration-store ) so I expected this to work with Feature Management as well. It was even more unexpected that I had to use builder.Services.AddFeatureManagement(builder.Configuration.GetSection("FeatureManagement:MyPrefix")); I think it would be important that we could use the same separator for regular keys and for flags when using Feature Management with Azure App Configuration. |
#288 |
Given the following configuration:
Querying the features was a bit surprising at first:
Listing the feature names is also quite misleading:
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
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).The text was updated successfully, but these errors were encountered: