When you use formatNullable[A] that means that you will get an Option[A], None if the field is missing and Some(a: A) if the field is present.

In your case class you have typed dob, address and phone as String but then in your format you say formatNullable[String] which means that the list of values that has been parsed does not match the apply method that you have provided (Person.apply). The error message tells you the expected parameter list of the function given and the actual one.

Change the fields in the case class, your format or provide an intermediate function instead of Person.apply that provides defaults if the values are not present and creates an instance of Person.

Related Query

More Query from same tag