Skip to content

Commit 126f812

Browse files
fix(client): disallow coercion from float to int
1 parent 29f6004 commit 126f812

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

lithic-java-core/src/main/kotlin/com/lithic/api/core/ObjectMappers.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ fun jsonMapper(): JsonMapper =
4343
}
4444
.withCoercionConfig(LogicalType.Integer) {
4545
it.setCoercion(CoercionInputShape.Boolean, CoercionAction.Fail)
46+
.setCoercion(CoercionInputShape.Float, CoercionAction.Fail)
4647
.setCoercion(CoercionInputShape.String, CoercionAction.Fail)
4748
.setCoercion(CoercionInputShape.Array, CoercionAction.Fail)
4849
.setCoercion(CoercionInputShape.Object, CoercionAction.Fail)

lithic-java-core/src/test/kotlin/com/lithic/api/core/ObjectMappersTest.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ internal class ObjectMappersTest {
4646
val VALID_CONVERSIONS =
4747
listOf(
4848
FLOAT to DOUBLE,
49-
FLOAT to INTEGER,
50-
FLOAT to LONG,
5149
DOUBLE to FLOAT,
52-
DOUBLE to INTEGER,
53-
DOUBLE to LONG,
5450
INTEGER to FLOAT,
5551
INTEGER to DOUBLE,
5652
INTEGER to LONG,

0 commit comments

Comments
 (0)