pureconfig icon indicating copy to clipboard operation
pureconfig copied to clipboard

Support a simpler form of manual derivation

Open chetanmeh opened this issue 5 years ago • 0 comments

With #420 support was added for manual derivation. This mode requires one to explicitly enumerate the field names like

implicit val personReader = ConfigReader.forProduct2("name", "surname")(Person(_, _))

It would be easier if we can avoid listing the field names explicitly. We can use an approach similar to one taken in spray-json which enables creating custom formats for case classes like

object MyJsonProtocol extends DefaultJsonProtocol {
  implicit val colorFormat = jsonFormat4(Color)
}

This would enable one to avoid using shapeless based approach with lesser effort and still benefit from not having any significant impact on compile times.

See discussion on gitter

chetanmeh avatar Jun 11 '19 12:06 chetanmeh