Packages

object Circe extends JsonCodeGen

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Circe
  2. JsonCodeGen
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. def generateEnumFieldDecoder(enumTrait: Name, enumValues: List[String]): List[Stat]

    enumTrait

    the enum trait

    enumValues

    all enum field names

    returns

    a json decoder instance for enum types

    Definition Classes
    CirceJsonCodeGen
  10. def generateEnumFieldEncoder(enumTrait: Name, enumValues: List[String]): List[Stat]

    enumTrait

    the enum trait

    enumValues

    all enum field names

    returns

    a json decoder instance for enum types

    Definition Classes
    CirceJsonCodeGen
  11. def generateFieldDecoder(name: Name): List[Stat]

    name

    the field name

    returns

    a json decoder instance

    Definition Classes
    CirceJsonCodeGen
  12. def generateFieldEncoder(name: Name): List[Stat]

    name

    the field name

    returns

    a json encoder instance

    Definition Classes
    CirceJsonCodeGen
  13. def generateUnionFieldDecoder(unionTrait: Name, unionNames: List[String], typeDiscriminatorField: String): List[Stat]

    unionTrait

    the union trait

    unionNames

    all union field names

    typeDiscriminatorField

    the field which determines the output type for union types

    returns

    a json decoder instance for union types

    Definition Classes
    CirceJsonCodeGen
  14. def generateUnionFieldEncoder(unionTrait: Name, unionNames: List[String], typeDiscriminatorField: String): List[Stat]

    GraphQL doesn't support unions in arguments (only in responses), so generating an Encoder might seem silly at first.

    GraphQL doesn't support unions in arguments (only in responses), so generating an Encoder might seem silly at first. It is still needed if deriveEncoder in generated code references a union (otherwise the compilation fails) or if you want to generate json responses using the generated code (e.g. in tests for your application).

    To match the Decoder we pattern match on the unionTrait and produce a json object using deriveEncoder based on the case we have. This avoids the default nesting of sum-types circe does. The discriminator field typename is automatically included via deriveEncoder as the generated code for each case includes it as normal field already.

    We could make sure that the value for typename is always the name of the type, ignoring the value someone put in the field of the case class. As of now, we don't do that, so test-code potentially has to do this manually but is also not bound to a hardcoded value in the Encoder here (e.g. for testing invalid responses).

    unionTrait

    the union trait

    unionNames

    all union field names

    typeDiscriminatorField

    the field which determines the output type for union types

    returns

    a json encoder instance for union types

    Definition Classes
    CirceJsonCodeGen
  15. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def imports: List[Stat]

    returns

    necessary imports for this json codec

    Definition Classes
    CirceJsonCodeGen
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from JsonCodeGen

Inherited from AnyRef

Inherited from Any

Ungrouped