Added support for AppConfig Feature Flag profiles #229
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.
Added support for AppConfig Feature Flag profiles by allowing the consumer to nest the resulting JSON in a named parent node.
Description
This aims to allow consumers to inject feature flags into their application. The user cannot control the schema for AppConfig Feature Flag profiles because they are controlled by AWS. The JSON format is like this:
This is not friendly with the .NET builder.Configuration system because there is no named wrapper node around the list of feature flags. The result is that each flag is nested directly under the root of the configuration hierarchy.
This update allows the consumer to pass in the name of a wrapper node to nest the AppConfig JSON inside of by using the extension method for AppConfig registration:
And then read the values from that configuration profile, by deserializing the JSON into a dictionary of feature flag class instances:
Motivation and Context
The end goal is to allow the consumer to inject feature flags into their controllers and minimal API class constructors, such as in the following:
This addresses the following feature request:
#228
Testing
Initial testing was done by creating a unit test. Follow-up testing was done by integrating the library into an application that consumed both configuration profiles and feature flag profiles. The tests validated both profiles loaded correctly and were injected into the services DI container.
Screenshots (if appropriate)
Types of changes
Checklist
License