Last active
November 13, 2021 07:49
-
-
Save seeni-dev/740a92a001ad665c6913d6390db78b66 to your computer and use it in GitHub Desktop.
SampleApp.scala
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 io.circe._, io.circe.generic.semiauto._, io.circe.syntax._ | |
val johnDoe = Person("John Doe", 24, Address(5, "Times Square Street", "New York", "12345")) | |
println(Person.encode(johnDoe)) | |
val encodedText = """ | |
{ | |
"name" : "Fin", | |
"age" : 21, | |
"address" : { | |
"doorNo" : 7, | |
"street" : "Staten Island", | |
"city" : "New York", | |
"zipCode" : "23456" | |
} | |
} | |
""" | |
val decodedJohnDoe = Person.decode(encodedText) | |
println(decodedJohnDoe) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment