case class Foo(value1: Option[String], value2: Option[String]) derives ArgBuilder
I expect that the derived ArgBuilder#build should work in the following ways:
Input: {}, output: Right(Foo(None, None))
Input: null, output Left(ExecutionError("bla"))
However, currently both cases succeed with Foo(None, None). Can be reproduced with the following test that should pass but fails since the first condition is not Left
suite("derived build")(
test("should fail when null is provided for case class with optional fields") {
case class Foo(value: Option[String])
val ab = ArgBuilder.gen[Foo]
assertTrue(
ab.build(NullValue).isLeft,
ab.build(ObjectValue(Map())).isRight
)
}
)
PS: This is not a problem when validation is enabled as an error will be raised during the validation phase
Given the following case class:
I expect that the derived
ArgBuilder#build
should work in the following ways:{}
, output:Right(Foo(None, None))
null
, outputLeft(ExecutionError("bla"))
However, currently both cases succeed with
Foo(None, None)
. Can be reproduced with the following test that should pass but fails since the first condition is notLeft
PS: This is not a problem when validation is enabled as an error will be raised during the validation phase