-
Notifications
You must be signed in to change notification settings - Fork 32
feat: add getFeatureVariableJSON and getAllFeatureVariables apis #375
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, 2 small comments
@@ -671,6 +711,10 @@ public String getFeatureVariableString(@Nonnull String featureKey, | |||
} | |||
|
|||
Object convertedValue = convertStringToType(variableValue, variableType); | |||
Object notificationValue = convertedValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be done in convertStringToType() like the others ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need notification map type different from the return OptimizelyJSON type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to the comment, convertStringToType() is used only for notification listener. You already have a case there for json type, can you return a map there ?
Map<String, Object> valuesMap = new HashMap<String, Object>(); | ||
for (FeatureVariable variable : featureFlag.getVariables()) { | ||
String value = variable.getDefaultValue(); | ||
if (featureEnabled && variation != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if we need to check for null variation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed. A good catch.
Pull Request Test Coverage Report for Build 1394
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a couple nits on the imports.
import com.google.gson.JsonElement; | ||
import com.google.gson.JsonIOException; | ||
import com.google.gson.JsonSyntaxException; | ||
import com.google.gson.stream.JsonWriter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why were these imports added?
@@ -18,6 +18,7 @@ | |||
|
|||
import com.google.gson.Gson; | |||
import com.google.gson.GsonBuilder; | |||
import com.google.gson.JsonSyntaxException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import?
Summary