-
-
Save rauanmayemir/153f670bfc9150b7edfa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.json4s._ | |
import org.json4s.jackson.Serialization | |
case class Person(name: String) | |
case class Alias(name: String) | |
case class PersonWithAliases(p: Person, aliases: List[Alias]) | |
implicit val formats = Serialization.formats(NoTypeHints) | |
val personWithAliases = PersonWithAliases(Person("Jacques"), List(Alias("Jack"), Alias("Jacky"))) | |
val jsontext = Serialization.write(personWithAliases); | |
val parsed = Serialization.read[PersonWithAliases](jsontext); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment