Skip to content

Commit 68dc96a

Browse files
authored
Update README.md
Signed-off-by: Ash.Wani <[email protected]>
1 parent 809688b commit 68dc96a

File tree

1 file changed

+8
-5
lines changed
  • src/OpenFeature.Contrib.Providers.AwsAppConfig

1 file changed

+8
-5
lines changed

src/OpenFeature.Contrib.Providers.AwsAppConfig/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,20 @@ namespace OpenFeatureTestApp
105105

106106
```csharp
107107
// Example endpoints using feature flags
108-
app.MapGet("/feature-status", async (IFeatureClient featureClient) =>
108+
app.MapGet("/flagKey", async (IFeatureClient featureClient) =>
109109
{
110-
var key = new AppConfigKey(configurationProfileId, flagKey, attributeName);
110+
// NOTE: Refere AppConfig Key section above to understand how AppConfig configuration is strucutred.
111+
var key = new AppConfigKey(configurationProfileId, flagKey, "enabled");
111112
var isEnabled = await featureClient.GetBooleanValue(key.ToKeyString(), false);
112113
return Results.Ok(new { FeatureEnabled = isEnabled });
113114
})
114115
.WithName("GetFeatureStatus")
115116
.WithOpenApi();
116117

117-
app.MapGet("/feature-config", async (IFeatureClient featureClient) =>
118+
app.MapGet("/flagKey/attributeKey", async (IFeatureClient featureClient) =>
118119
{
119-
var key = new AppConfigKey(configurationProfileId, flagKey, attributeName);
120+
// NOTE: Refere AppConfig Key section above to understand how AppConfig configuration is strucutred.
121+
var key = new AppConfigKey(configurationProfileId, flagKey, attributeKey);
120122
var config = await featureClient.GetStringValue(key.ToKeyString(), "default");
121123
return Results.Ok(new { Configuration = config });
122124
})
@@ -130,7 +132,8 @@ app.MapGet("/feature-config", async (IFeatureClient featureClient) =>
130132
// Example endpoint with feature flag controlling behavior
131133
app.MapGet("/protected-feature", async (IFeatureClient featureClient) =>
132134
{
133-
var isFeatureEnabled = await featureClient.GetBooleanValue("protected-feature", false);
135+
var key = new AppConfigKey(configurationProfileId, "protected-feature", "enabled");
136+
var isFeatureEnabled = await featureClient.GetBooleanValue(key.ToKeyString(), false);
134137

135138
if (!isFeatureEnabled)
136139
{

0 commit comments

Comments
 (0)