diff --git a/engine/baml-lib/jsonish/src/tests/test_unions.rs b/engine/baml-lib/jsonish/src/tests/test_unions.rs index b8619022b..dbdacbf7d 100644 --- a/engine/baml-lib/jsonish/src/tests/test_unions.rs +++ b/engine/baml-lib/jsonish/src/tests/test_unions.rs @@ -288,3 +288,14 @@ test_deserializer!( ]), "1 cup unsalted butter, room temperature" ); + +test_deserializer!( + test_ignore_int_if_string_in_union, + "", + "1 cup unsalted butter, room temperature", + FieldType::Union(vec![ + FieldType::Primitive(TypeValue::Int), + FieldType::Primitive(TypeValue::String), + ]), + "1 cup unsalted butter, room temperature" +);