Packages

o

zio.json.codegen

Generator

object Generator

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Generator
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. def printCaseClasses(input: String): Unit

    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
    }