object Circe extends JsonCodeGen
- Alphabetic
- By Inheritance
- Circe
- JsonCodeGen
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
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
- Circe → JsonCodeGen
-
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
- Circe → JsonCodeGen
-
def
generateFieldDecoder(name: Name): List[Stat]
- name
the field name
- returns
a json decoder instance
- Definition Classes
- Circe → JsonCodeGen
-
def
generateFieldEncoder(name: Name): List[Stat]
- name
the field name
- returns
a json encoder instance
- Definition Classes
- Circe → JsonCodeGen
-
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
- Circe → JsonCodeGen
-
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
deriveEncoderin 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
unionTraitand produce a json object usingderiveEncoderbased on the case we have. This avoids the default nesting of sum-typescircedoes. The discriminator fieldtypenameis automatically included viaderiveEncoderas the generated code for each case includes it as normal field already.We could make sure that the value for
typenameis 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
- Circe → JsonCodeGen
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
imports: List[Stat]
- returns
necessary imports for this json codec
- Definition Classes
- Circe → JsonCodeGen
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()