configcat / android-sdk

ConfigCat SDK for Android. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
https://configcat.com/docs/sdk-reference/android
MIT License
13 stars 3 forks source link

Please make SettingType public #19

Closed valeriyo closed 2 years ago

valeriyo commented 2 years ago

When I implemented local overrides, I had to hard-code Setting.type values to 0, 1, 2, 3 per comment:

    /**
     * Type of the feature flag / setting.
     *
     * 0: [bool],
     * 1: [String],
     * 2: [int],
     * 3: [double],
     */
    @SerializedName(value = "t")
    public int type;

However, there is enum SettingType with these ordinal values, and I would rather use it. However, it's package private, and cannot be (easily) used outside of the configcat library:

https://github.com/configcat/android-sdk/blob/master/src/main/java/com/configcat/ConfigModels.java#L8

Please make SettingType public.

Even better, make the type field of type SettingType (with a custom serializer, if GSON allows?):

    @SerializedName(value = "t")
    public SettingType type;
z4kn4fein commented 2 years ago

Hi @valeriyo, thank you for reporting! We started working on this, I've also opened a PR #20.

z4kn4fein commented 2 years ago

It's released in v7.2.0