aboutsummaryrefslogtreecommitdiff
path: root/shared/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'shared/src/main')
-rw-r--r--shared/src/main/scala/DerivedFormats.scala2
-rw-r--r--shared/src/main/scala/annotations.scala8
2 files changed, 5 insertions, 5 deletions
diff --git a/shared/src/main/scala/DerivedFormats.scala b/shared/src/main/scala/DerivedFormats.scala
index ed39f46..7c13314 100644
--- a/shared/src/main/scala/DerivedFormats.scala
+++ b/shared/src/main/scala/DerivedFormats.scala
@@ -68,7 +68,7 @@ trait DerivedFormats { self: BasicFormats =>
.collectFirst {
case g: adt => g.typeFieldName
}
- .getOrElse("type")
+ .getOrElse("@type")
new JsonFormat[T] {
override def write(value: T): JsValue = ctx.dispatch(value) { sub =>
diff --git a/shared/src/main/scala/annotations.scala b/shared/src/main/scala/annotations.scala
index 4437aeb..ad2a37f 100644
--- a/shared/src/main/scala/annotations.scala
+++ b/shared/src/main/scala/annotations.scala
@@ -7,16 +7,16 @@ import scala.annotation.StaticAnnotation
* added to the final JSON objects.
*
* Note that by default all sealed traits are treated as ADTs, with a type
- * field called `type`. This annotation enables overriding the name of that
+ * field called `@type`. This annotation enables overriding the name of that
* field and is really only useful if a child itself has a field called `type`
* that would otherwise result in a conflict.
*
* Example:
* {{{
* // the JSON field "kind" will contain the actual type of the serialized child
- * @adt("kind") sealed abstract class Keyword(`type`: String)
- * case class If(`type`: String) extends Keyword(`type`)
+ * @adt("kind") sealed abstract class Keyword(`@type`: String)
+ * case class If(`@type`: String) extends Keyword(`@type`)
* }}}
* @param typeFieldName the name of the field to inject into a serialized JSON
* object */
-final class adt(val typeFieldName: String = "type") extends StaticAnnotation
+final class adt(val typeFieldName: String = "@type") extends StaticAnnotation