package json
- Alphabetic
- By Inheritance
- json
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
DerivedFormats extends AnyRef
Mixin that enables derivation of JSON formats for any product (case classes) or coproduct (sealed traits) types.
- trait DerivedJsonProtocol extends DefaultJsonProtocol with DerivedFormats
- trait ImplicitDerivedFormats extends DerivedFormats
- trait ImplicitDerivedJsonProtocol extends DefaultJsonProtocol with ImplicitDerivedFormats
- type JsField = (String, JsValue)
-
trait
KebabCase extends AnyRef
Serialize parametersOfCaseClasses as parameters-of-case-classes.
-
trait
SnakeCase extends AnyRef
Serialize parametersOfCaseClasses as parameters_of_case_classes.
-
final
class
gadt extends Annotation with StaticAnnotation
An annotation that designates that a sealed trait is a generalized algebraic datatype (GADT), and that a field containing the serialized childrens' types should be added to the final JSON objects.
An annotation that designates that a sealed trait is a generalized algebraic datatype (GADT), and that a field containing the serialized childrens' types should be added to the final JSON objects.
Note that by default all sealed traits are treated as GADTs, with a type field called
type
. This annotation enables overriding the name of that field and is really only useful if a child itself has a field calledtype
that would otherwise result in a conflict.Example:
// the JSON field "kind" will contain the actual type of the serialized child @gadt("kind") sealed abstract class Keyword(`type`: String) case class If(`type`: String) extends Keyword(`type`)
Value Members
- def deserializationError(msg: String, cause: Throwable, fieldNames: List[String]): Nothing
- implicit def enrichAny[T](any: T): RichAny[T]
- implicit def enrichString(string: String): RichString
- def jsonReader[T](implicit reader: JsonReader[T]): JsonReader[T]
- def jsonWriter[T](implicit writer: JsonWriter[T]): JsonWriter[T]
- def serializationError(msg: String): Nothing
- object DerivedFormatMacros
- object DerivedJsonProtocol extends DerivedJsonProtocol
- object FieldNaming
- object ImplicitDerivedJsonProtocol extends ImplicitDerivedJsonProtocol
Deprecated Value Members
-
def
pimpAny[T](any: T): PimpedAny[T]
- Annotations
- @deprecated
- Deprecated
(Since version 1.3.4) use enrichAny
-
def
pimpString(string: String): PimpedString
- Annotations
- @deprecated
- Deprecated
(Since version 1.3.4) use enrichString
-
object
DerivedFormats extends DerivedFormats with DefaultJsonProtocol
- Annotations
- @deprecated
- Deprecated
(Since version spray-json-derivation 0.4.3) use DerivedJsonProtocol
-
object
ImplicitDerivedFormats extends ImplicitDerivedFormats with DefaultJsonProtocol
- Annotations
- @deprecated
- Deprecated
(Since version spray-json-derivation 0.4.3) use ImplicitDerivedJsonProtocol