azure-sdk-for-js icon indicating copy to clipboard operation
azure-sdk-for-js copied to clipboard

Feature flags are missing prop requirement_type after using parseFeatureFlag

Open iPrytz opened this issue 4 months ago • 1 comments

  • Package Name:
  • "@azure/app-configuration"
  • Package Version:
  • "1.7.0"
  • Operating system:
  • [X] nodejs
    • version:
    • 20
  • Is the bug related to documentation in
    • [ ] README.md
    • [ ] source code documentation
    • [X] SDK API docs on https://learn.microsoft.com
    • https://learn.microsoft.com/en-us/javascript/api/%40azure/app-configuration/?view=azure-node-latest#@azure-app-configuration-parsefeatureflag

Describe the bug I am consuming the app-configuration package to get feature flags from our App Config. Everyting works great to fetch the config and to use parseFeatureFlag. I get all the data exept for the property conditions.requirement_type. Here is the problem, only selecting conditions.client_filters : https://github.com/Azure/azure-sdk-for-js/blob/113b188eba7cc41cd79de8a7b6d886208c9e3165/sdk/appconfiguration/app-configuration/src/featureFlag.ts#L115

To Reproduce Steps to reproduce the behavior:

  1. create a feature flag in app config in azure portal
  2. install and use the @azure/app-configuration in node to set up the client to be able to fetch the config
  3. use the client.getConfigurationSetting to fetch the feature flag
  4. use parseFeatureFlag to parse the GetConfigurationSettingResponse
  5. data.value.conditions.requirement_type dosn't exist

Expected behavior I expect the json data data.value.conditions.requirement_type to be inluded in the parsed object,

Screenshots This is the parsed json without using the built in parseFeatureFlag:

{
    "client_filters": [
        {
            "name": "Microsoft.Targeting",
            "parameters": {
                "Audience": {
                    "Users": [
                        "dev-user"
                    ],
                    "Groups": [
                        {
                            "Name": "dev-group",
                            "RolloutPercentage": 100
                        }
                    ],
                    "DefaultRolloutPercentage": 50
                }
            }
        },
        {
            "name": "Microsoft.TimeWindow",
            "parameters": {
                "Start": "Tue, 15 Oct 2024 22:00:00 GMT",
                "End": "Tue, 29 Oct 2024 23:00:00 GMT"
            }
        },
        {
            "name": "My-Filter",
            "parameters": {
                "ID": 0
            }
        }
    ],
    "requirement_type": "All"
}

Additional context

iPrytz avatar Oct 17 '24 10:10 iPrytz