I have a case class like this:
case class Admin(name: String, role: Role)
Role
is an Enumeration
object Role extends Enumeration {
type Role = Value
val Manager = Value
}
When I try to:
import io.circe.generic.auto._, io.circe.syntax._
val response = Admin("John", Role.Manager).asJson.noSpaces
I get the implicit Encoder not found error.
not enough arguments for method asJson: (implicit encoder: io.circe.Encoder[Admin])io.circe.Json. Unspecified value parameter encoder.
I suppose this error is due Enumeration, so I changed to:
trait Role
object Role {
object Manager extends Role
}
But this does't work too.
Lastly, I tried:
trait Role
object Manager extends Role
And no success. Can someone help me please? Thanks!