json4s - how to use multiple FieldSerializer

Viewed 468

What is the correct syntax to use multiple FieldSerializer? I'm trying to rename 3 fields it only works if I concat one of them with DefaultFormats

val currg = FieldSerializer[Currency](renameTo("gameCurr", "gameCurr"), renameFrom("currg", "gameCurr"))
val curre = FieldSerializer[Currency](renameTo("currency", "currency"), renameFrom("curre", "currency"))
val lprice = FieldSerializer[Currency](renameTo("price", "price"), renameFrom("lprice", "price"))

implicit val formats = org.json4s.DefaultFormats + lprice //+ curre + currg 

If I let only a single FieldSerializer, it works like a charm

implicit val formats = org.json4s.DefaultFormats + lprice
1 Answers
Related