Generator
object Generator
Value members
Concrete methods
Renders the JSON string as a series of Scala case classes derived from the structure of the JSON.
Renders the JSON string as a series of Scala case classes derived from the structure of the JSON.
For example, the following JSON:
{
"foo": "bar",
"baz": {
"qux": "quux"
}
}
Would print the following Scala code to the console:
final case class RootObject(
foo: String,
baz: Baz
)
object RootObject {
implicit val codec: JsonCoder[RootObject] = DeriveJsonCodec.gen
}
final case class Baz(
qux: String
)
object Baz {
implicit val codec: JsonCoder[Baz] = DeriveJsonCodec.gen
}