io.circe.syntax._ case class User(id: Long, firstName: String, lastName: String) implicit val decoderUser: Decoder[User] = Decoder.forProduct3("id", "first_name", "last_name")(User) implicit val encoderUser: Encoder[User] = Encoder.forProduct3("id", "first_name", "last_name")(u => (u.id, u.firstName, u.lastName))