This question is related to the following two questions.
We wanted to use enumeration in a model in our play 2.1 application so we found the following question How to write Reads[T] and Writes[T] in scala Enumeration (play framework 2.1)
It's then mentioned that using case class in scala is better than scala enumeration. So we found the following question
Case objects vs Enumerations in Scala
How do we write json format for the case class enumeration suggested above then? Namely the case class enumeration is like
trait Enum[A] {
trait Value { self: A => }
val values: List[A]
}
sealed trait Currency extends Currency.Value
object Currency extends Enum[Currency] {
case object EUR extends Currency
case object GBP extends Currency
val values = List(EUR, GBP)
}
We are new to Play/scala especially its functional JSON api. I tried to write Thanks