Simple types: Int
, Double
, Boolean
, String
etc work out of the box.
import ba.sake.tupson.{given, *}
// write a value to JSON string
val myValue = 123
println(123.toJson) // 123
// parse a value from JSON string
val myParsedValue = """123""".parseJson[Int]
println(myParsedValue) // 123