Created
May 7, 2020 07:43
-
-
Save ruseel/ed6426c8542bef3fc2379de86538c0fa to your computer and use it in GitHub Desktop.
json4s
This file contains hidden or 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.native.JsonMethods._ | |
import org.json4s.native.Serialization | |
import org.json4s.native.Serialization.write | |
case class A(s: String, i: Int) | |
implicit val formats = Serialization.formats(NoTypeHints) | |
val a = A("a", 1) | |
val s = write(a) | |
print(s) | |
val aa = parse(write(a)).extract[A] | |
print(aa) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment