Skip to content

Commit dd93adf

Browse files
Fixed Json Parsing Issue (#15)
1 parent 9adb5af commit dd93adf

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/main/kotlin/com/featurevisor/sdk/Instance+Feature.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ internal fun FeaturevisorInstance.getMatchedAllocation(
4949

5050
return traffic.allocation.firstOrNull { allocation ->
5151
with(allocation.range) {
52-
bucketValue in start..end
52+
bucketValue in this.first()..this.last()
5353
}
5454
}
5555
}

src/main/kotlin/com/featurevisor/types/Types.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ data class VariableOverride(
4949
val value: VariableValue,
5050

5151
// one of the below must be present in YAML
52-
val conditions: Condition?,
52+
val conditions: Condition? = null,
5353
val segments: GroupSegment?,
5454
)
5555

@@ -63,7 +63,7 @@ data class Variable(
6363
@Serializable
6464
data class Variation(
6565
// only available in YAML
66-
val description: String?,
66+
val description: String? = null,
6767

6868
val value: VariationValue,
6969

@@ -87,12 +87,12 @@ typealias VariableValues = Map<VariableKey, VariableValue>
8787
@Serializable
8888
data class Force(
8989
// one of the below must be present in YAML
90-
val conditions: Condition?,
91-
val segments: GroupSegment?,
90+
val conditions: Condition? = null,
91+
val segments: GroupSegment? = null,
9292

93-
val enabled: Boolean?,
94-
val variation: VariationValue?,
95-
val variables: VariableValues?,
93+
val enabled: Boolean? = null,
94+
val variation: VariationValue? = null,
95+
val variables: VariableValues? = null,
9696
)
9797

9898
data class Slot(
@@ -324,7 +324,7 @@ data class Range(
324324
@Serializable
325325
data class Allocation(
326326
val variation: VariationValue,
327-
val range: Range,
327+
val range: List<Int>,
328328
)
329329

330330
@Serializable

0 commit comments

Comments
 (0)