diff options
author | Jakob Odersky <jakob@odersky.com> | 2018-08-02 15:42:22 -0700 |
---|---|---|
committer | Jakob Odersky <jakob@odersky.com> | 2018-08-02 16:04:39 -0700 |
commit | 37ad3c66baa2df36594277022dcf68fa8d4fff26 (patch) | |
tree | 7cc7c80f0c94a67b5c6078cbe8bdb1759d57e472 /shared/src/main/scala/annotations.scala | |
parent | 20afa757f499688b56cbd6b8571014b75d6d4dce (diff) | |
download | spray-json-derivation-37ad3c66baa2df36594277022dcf68fa8d4fff26.tar.gz spray-json-derivation-37ad3c66baa2df36594277022dcf68fa8d4fff26.tar.bz2 spray-json-derivation-37ad3c66baa2df36594277022dcf68fa8d4fff26.zip |
Rename default type field to '@type'
Diffstat (limited to 'shared/src/main/scala/annotations.scala')
-rw-r--r-- | shared/src/main/scala/annotations.scala | 8 |
1 files changed, 4 insertions, 4 deletions
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 |