Skip to content

Commit 012dbc8

Browse files
fix(client): disallow coercion from float to int
1 parent 0723676 commit 012dbc8

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ fun jsonMapper(): JsonMapper =
4848
}
4949
.withCoercionConfig(LogicalType.Integer) {
5050
it.setCoercion(CoercionInputShape.Boolean, CoercionAction.Fail)
51+
.setCoercion(CoercionInputShape.Float, CoercionAction.Fail)
5152
.setCoercion(CoercionInputShape.String, CoercionAction.Fail)
5253
.setCoercion(CoercionInputShape.Array, CoercionAction.Fail)
5354
.setCoercion(CoercionInputShape.Object, CoercionAction.Fail)

stagehand-java-core/src/test/kotlin/com/browserbase/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)