Skip to content

Commit

Permalink
try to fix tracks deserialization in rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Volodymyr Nazarkevych committed Feb 12, 2025
1 parent f7e199d commit d42fa66
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/src/main/java/growthbook/sdk/java/model/FeatureRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class FeatureRule<ValueType> extends SuperTypeToken<ValueType> implements JsonDeserializer<FeatureRule<ValueType>>{
public class FeatureRule<ValueType> extends SuperTypeToken<ValueType> implements JsonDeserializer<FeatureRule<ValueType>> {
/**
* Unique feature rule id
*/
Expand Down Expand Up @@ -251,7 +251,8 @@ public FeatureRule<ValueType> deserialize(JsonElement json, Type typeOfT, JsonDe
builder.minBucketVersion(jsonObject.has("minBucketVersion") ? context.deserialize(jsonObject.get("minBucketVersion"), Integer.class) : null);

if (jsonObject.has("tracks")) {
builder.tracks(context.deserialize(jsonObject.get("tracks"), TypeToken.getParameterized(ArrayList.class, TrackData.class, getType()).getType()));
builder.tracks(context.deserialize(jsonObject.get("tracks"), TypeToken.getParameterized(ArrayList.class, TrackData.class).getType()));
// builder.tracks(context.deserialize(jsonObject.get("tracks"), new TypeToken<ArrayList<TrackData<ValueType>>>() {}.getType()));
}

return builder.build();
Expand Down

0 comments on commit d42fa66

Please sign in to comment.