Skip to content

Instantly share code, notes, and snippets.

@ruseel
Created May 7, 2020 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruseel/ed6426c8542bef3fc2379de86538c0fa to your computer and use it in GitHub Desktop.
Save ruseel/ed6426c8542bef3fc2379de86538c0fa to your computer and use it in GitHub Desktop.
json4s
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