argonaut-shapeless
argonaut-shapeless copied to clipboard
Add @Wrapper annotation
To annotate case classes having a single field, like
@Wrapper case class Something(underlying: Underlying)
whose JSON representation is the one of the field.
Would avoid to write boilerplate like
case class Something(underlying: String)
object Something {
implicit val decode = DecodeJson.of[Underlying].map(Something(_))
implicit val encode = EncodeJson.of[Underlying].contramap[Something](_.underlying)
}
for simply
@Wrapper case class Something(underlying: Underlying)
Maybe as a macro?